Fixed minor rendering issues.
authorNathan Heisey <nathanheisey@gmail.com>
Wed, 03 Aug 2011 05:09:36 +0000
changeset 5932cd08863bcb49
parent 5931 edf9a8e68b34
child 5933 5f8a7ebc88e5
Fixed minor rendering issues.
src/video/bwindow/SDL_BWin.h
src/video/bwindow/SDL_bframebuffer.cc
src/video/bwindow/SDL_bwindow.cc
     1.1 --- a/src/video/bwindow/SDL_BWin.h	Sat Jul 30 18:26:13 2011 +0000
     1.2 +++ b/src/video/bwindow/SDL_BWin.h	Wed Aug 03 05:09:36 2011 +0000
     1.3 @@ -63,8 +63,8 @@
     1.4  {
     1.5    public:
     1.6    	/* Constructor/Destructor */
     1.7 -    SDL_BWin(BRect bounds):BDirectWindow(bounds, "Untitled",
     1.8 -                                         B_TITLED_WINDOW, 0)
     1.9 +    SDL_BWin(BRect bounds, uint32 flags):BDirectWindow(bounds, "Untitled",
    1.10 +                                         B_TITLED_WINDOW, flags)
    1.11      {
    1.12          _last_buttons = 0;
    1.13  
     2.1 --- a/src/video/bwindow/SDL_bframebuffer.cc	Sat Jul 30 18:26:13 2011 +0000
     2.2 +++ b/src/video/bwindow/SDL_bframebuffer.cc	Wed Aug 03 05:09:36 2011 +0000
     2.3 @@ -53,7 +53,7 @@
     2.4  	
     2.5  	/* Make sure we have exclusive access to frame buffer data */
     2.6  	bwin->LockBuffer();
     2.7 -	
     2.8 +
     2.9  	/* format */
    2.10  	display_mode bmode;
    2.11  	bscreen.GetMode(&bmode);
     3.1 --- a/src/video/bwindow/SDL_bwindow.cc	Sat Jul 30 18:26:13 2011 +0000
     3.2 +++ b/src/video/bwindow/SDL_bwindow.cc	Wed Aug 03 05:09:36 2011 +0000
     3.3 @@ -38,20 +38,32 @@
     3.4  }
     3.5  
     3.6  int _InitWindow(_THIS, SDL_Window *window) {
     3.7 +	uint32 flags = 0;
     3.8  	BRect bounds(
     3.9          window->x,
    3.10          window->y,
    3.11          window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
    3.12          window->y + window->h - 1
    3.13      );
    3.14 +    
    3.15 +    if(window->flags & SDL_WINDOW_FULLSCREEN) {
    3.16 +    }
    3.17 +    if(window->flags & SDL_WINDOW_OPENGL) {
    3.18 +    }
    3.19 +    if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
    3.20 +    	flags |= B_NOT_RESIZABLE;
    3.21 +    }
    3.22 +    if(window->flags & SDL_WINDOW_BORDERLESS) {
    3.23 +    }
    3.24  
    3.25 -    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds);
    3.26 +    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, flags);
    3.27      if(bwin == NULL)
    3.28      	return ENOMEM;
    3.29  
    3.30      window->driverdata = bwin;
    3.31      int32 winID = _GetBeApp()->GetID(window);
    3.32      bwin->SetID(winID);
    3.33 +
    3.34      return 0;
    3.35  }
    3.36  
    3.37 @@ -59,6 +71,7 @@
    3.38  	if(_InitWindow(_this, window) == ENOMEM)
    3.39  		return ENOMEM;
    3.40  	
    3.41 +	printf("Flags = 0x%x\n", window->flags);
    3.42  	/* Start window loop */
    3.43      _ToBeWin(window)->Show();
    3.44      return 0;
    3.45 @@ -76,6 +89,11 @@
    3.46  	window->w = (int)otherBWin->Frame().Width();
    3.47  	window->h = (int)otherBWin->Frame().Height();
    3.48  	
    3.49 +	/* Set SDL flags */
    3.50 +	if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
    3.51 +		window->flags |= SDL_WINDOW_RESIZABLE;
    3.52 +	}
    3.53 +	
    3.54  	/* If we are out of memory, return the error code */
    3.55  	if(_InitWindow(_this, window) == ENOMEM)
    3.56  		return ENOMEM;