Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed minor rendering issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
antifinidictor committed Aug 3, 2011
1 parent 15a6c20 commit 354895b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/video/bwindow/SDL_BWin.h
Expand Up @@ -63,8 +63,8 @@ class SDL_BWin:public BDirectWindow
{
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;

Expand Down
2 changes: 1 addition & 1 deletion src/video/bwindow/SDL_bframebuffer.cc
Expand Up @@ -53,7 +53,7 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,

/* Make sure we have exclusive access to frame buffer data */
bwin->LockBuffer();

/* format */
display_mode bmode;
bscreen.GetMode(&bmode);
Expand Down
22 changes: 20 additions & 2 deletions src/video/bwindow/SDL_bwindow.cc
Expand Up @@ -38,27 +38,40 @@ static inline SDL_BApp *_GetBeApp() {
}

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
);

SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds);

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, flags);
if(bwin == NULL)
return ENOMEM;

window->driverdata = bwin;
int32 winID = _GetBeApp()->GetID(window);
bwin->SetID(winID);

return 0;
}

int BE_CreateWindow(_THIS, SDL_Window *window) {
if(_InitWindow(_this, window) == ENOMEM)
return ENOMEM;

printf("Flags = 0x%x\n", window->flags);
/* Start window loop */
_ToBeWin(window)->Show();
return 0;
Expand All @@ -76,6 +89,11 @@ int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
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;
Expand Down

0 comments on commit 354895b

Please sign in to comment.