Fixed minor rendering issues.
authorNathan Heisey <nathanheisey@gmail.com>
Wed, 03 Aug 2011 05:09:36 +0000
changeset 5932 cd08863bcb49
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
--- a/src/video/bwindow/SDL_BWin.h	Sat Jul 30 18:26:13 2011 +0000
+++ b/src/video/bwindow/SDL_BWin.h	Wed Aug 03 05:09:36 2011 +0000
@@ -63,8 +63,8 @@
 {
   public:
   	/* Constructor/Destructor */
-    SDL_BWin(BRect bounds):BDirectWindow(bounds, "Untitled",
-                                         B_TITLED_WINDOW, 0)
+    SDL_BWin(BRect bounds, uint32 flags):BDirectWindow(bounds, "Untitled",
+                                         B_TITLED_WINDOW, flags)
     {
         _last_buttons = 0;
 
--- a/src/video/bwindow/SDL_bframebuffer.cc	Sat Jul 30 18:26:13 2011 +0000
+++ b/src/video/bwindow/SDL_bframebuffer.cc	Wed Aug 03 05:09:36 2011 +0000
@@ -53,7 +53,7 @@
 	
 	/* Make sure we have exclusive access to frame buffer data */
 	bwin->LockBuffer();
-	
+
 	/* format */
 	display_mode bmode;
 	bscreen.GetMode(&bmode);
--- a/src/video/bwindow/SDL_bwindow.cc	Sat Jul 30 18:26:13 2011 +0000
+++ b/src/video/bwindow/SDL_bwindow.cc	Wed Aug 03 05:09:36 2011 +0000
@@ -38,20 +38,32 @@
 }
 
 int _InitWindow(_THIS, SDL_Window *window) {
+	uint32 flags = 0;
 	BRect bounds(
         window->x,
         window->y,
         window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
         window->y + window->h - 1
     );
+    
+    if(window->flags & SDL_WINDOW_FULLSCREEN) {
+    }
+    if(window->flags & SDL_WINDOW_OPENGL) {
+    }
+    if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
+    	flags |= B_NOT_RESIZABLE;
+    }
+    if(window->flags & SDL_WINDOW_BORDERLESS) {
+    }
 
-    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds);
+    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, flags);
     if(bwin == NULL)
     	return ENOMEM;
 
     window->driverdata = bwin;
     int32 winID = _GetBeApp()->GetID(window);
     bwin->SetID(winID);
+
     return 0;
 }
 
@@ -59,6 +71,7 @@
 	if(_InitWindow(_this, window) == ENOMEM)
 		return ENOMEM;
 	
+	printf("Flags = 0x%x\n", window->flags);
 	/* Start window loop */
     _ToBeWin(window)->Show();
     return 0;
@@ -76,6 +89,11 @@
 	window->w = (int)otherBWin->Frame().Width();
 	window->h = (int)otherBWin->Frame().Height();
 	
+	/* Set SDL flags */
+	if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
+		window->flags |= SDL_WINDOW_RESIZABLE;
+	}
+	
 	/* If we are out of memory, return the error code */
 	if(_InitWindow(_this, window) == ENOMEM)
 		return ENOMEM;