Commit 4799ac2b authored by Nathan Heisey's avatar Nathan Heisey

Partially cleaned out code

parent 491df9d7
...@@ -177,11 +177,6 @@ public: ...@@ -177,11 +177,6 @@ public:
} }
} }
/* Modes methods */
void SetPrevMode(display_mode *prevMode) { _saved_mode = prevMode; }
display_mode* GetPrevMode() { return _saved_mode; }
/* FIXME: Bad coding practice, but I can't include SDL_BWin.h here. Is /* FIXME: Bad coding practice, but I can't include SDL_BWin.h here. Is
there another way to do this? */ there another way to do this? */
void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */ void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */
...@@ -225,7 +220,7 @@ private: ...@@ -225,7 +220,7 @@ private:
win = GetSDLWindow(winID); win = GetSDLWindow(winID);
SDL_SendMouseMotion(win, 0, x, y); SDL_SendMouseMotion(win, 0, x, y);
/* FIXME: Attempt at fixing rendering problems */ /* Tell the application that the mouse passed over, redraw needed */
BE_UpdateWindowFramebuffer(NULL,win,NULL,-1); BE_UpdateWindowFramebuffer(NULL,win,NULL,-1);
} }
...@@ -328,9 +323,6 @@ private: ...@@ -328,9 +323,6 @@ private:
} }
win = GetSDLWindow(winID); win = GetSDLWindow(winID);
SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos); SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos);
/* FIXME: Attempt at fixing rendering problems */
// BE_UpdateWindowFramebuffer(NULL,win,NULL,-1); Handled by DirectConnected
} }
void _HandleWindowResized(BMessage *msg) { void _HandleWindowResized(BMessage *msg) {
...@@ -347,9 +339,6 @@ private: ...@@ -347,9 +339,6 @@ private:
} }
win = GetSDLWindow(winID); win = GetSDLWindow(winID);
SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h); SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h);
/* FIXME: Attempt at fixing rendering problems */
// BE_UpdateWindowFramebuffer(NULL,win,NULL,-1); Handled by DirectConnected
} }
bool _GetWinID(BMessage *msg, int32 *winID) { bool _GetWinID(BMessage *msg, int32 *winID) {
...@@ -379,7 +368,7 @@ private: ...@@ -379,7 +368,7 @@ private:
/* Members */ /* Members */
vector<SDL_Window*> _window_map; /* Keeps track of SDL_Windows by index-id */ vector<SDL_Window*> _window_map; /* Keeps track of SDL_Windows by index-id*/
display_mode *_saved_mode; display_mode *_saved_mode;
BGLView *_current_context; BGLView *_current_context;
......
...@@ -53,7 +53,7 @@ enum WinCommands { ...@@ -53,7 +53,7 @@ enum WinCommands {
BWIN_HIDE_WINDOW, BWIN_HIDE_WINDOW,
BWIN_MAXIMIZE_WINDOW, BWIN_MAXIMIZE_WINDOW,
BWIN_MINIMIZE_WINDOW, BWIN_MINIMIZE_WINDOW,
BWIN_RESTORE_WINDOW, /* TODO: IMPLEMENT THIS! */ BWIN_RESTORE_WINDOW,
BWIN_SET_TITLE, BWIN_SET_TITLE,
BWIN_FULLSCREEN BWIN_FULLSCREEN
}; };
...@@ -185,9 +185,6 @@ class SDL_BWin:public BDirectWindow ...@@ -185,9 +185,6 @@ class SDL_BWin:public BDirectWindow
_bits = (uint8*) info->bits; _bits = (uint8*) info->bits;
_row_bytes = info->bytes_per_row; _row_bytes = info->bytes_per_row;
_bounds = info->window_bounds; _bounds = info->window_bounds;
printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left,
_bounds.top, _bounds.right, _bounds.bottom, Frame().left, Frame().top,
Frame().right, Frame().bottom);
_bytes_per_px = info->bits_per_pixel / 8; _bytes_per_px = info->bits_per_pixel / 8;
_buffer_dirty = true; _buffer_dirty = true;
} }
...@@ -230,7 +227,8 @@ printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left, ...@@ -230,7 +227,8 @@ printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left,
virtual void FrameResized(float width, float height) { virtual void FrameResized(float width, float height) {
/* Post a message to the BApp so that it can handle the window event */ /* Post a message to the BApp so that it can handle the window event */
BMessage msg(BAPP_WINDOW_RESIZED); BMessage msg(BAPP_WINDOW_RESIZED);
msg.AddInt32("window-w", (int)width + 1); /* TODO: Check that +1 is needed */
msg.AddInt32("window-w", (int)width + 1);
msg.AddInt32("window-h", (int)height + 1); msg.AddInt32("window-h", (int)height + 1);
_PostWindowEvent(msg); _PostWindowEvent(msg);
...@@ -409,15 +407,12 @@ printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left, ...@@ -409,15 +407,12 @@ printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left,
uint32 GetRowBytes() { return _row_bytes; } uint32 GetRowBytes() { return _row_bytes; }
int32 GetFbX() { return _bounds.left; } int32 GetFbX() { return _bounds.left; }
int32 GetFbY() { return _bounds.top; } int32 GetFbY() { return _bounds.top; }
// int32 GetFbHeight() { return _bounds.bottom - _bounds.top + 1; }
// int32 GetFbWidth() { return _bounds.right - _bounds.left + 1; }
bool ConnectionEnabled() { return !_connection_disabled; } bool ConnectionEnabled() { return !_connection_disabled; }
bool Connected() { return _connected; } bool Connected() { return _connected; }
clipping_rect *GetClips() { return _clips; } clipping_rect *GetClips() { return _clips; }
int32 GetNumClips() { return _num_clips; } int32 GetNumClips() { return _num_clips; }
uint8* GetBufferPx() { return _bits; } uint8* GetBufferPx() { return _bits; }
int32 GetBytesPerPx() { return _bytes_per_px; } int32 GetBytesPerPx() { return _bytes_per_px; }
// uint8* GetWindowFramebuffer() { return _window_buffer; }
bool CanTrashWindowBuffer() { return _trash_window_buffer; } bool CanTrashWindowBuffer() { return _trash_window_buffer; }
bool BufferExists() { return _buffer_created; } bool BufferExists() { return _buffer_created; }
bool BufferIsDirty() { return _buffer_dirty; } bool BufferIsDirty() { return _buffer_dirty; }
...@@ -429,7 +424,6 @@ printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left, ...@@ -429,7 +424,6 @@ printf("Bounds = (%i,%i,%i,%i), Frame = (%0.f,%0.f,%0.f,%0.f)\n", _bounds.left,
/* Setter methods */ /* Setter methods */
void SetID(int32 id) { _id = id; } void SetID(int32 id) { _id = id; }
void SetBufferExists(bool bufferExists) { _buffer_created = bufferExists; } void SetBufferExists(bool bufferExists) { _buffer_created = bufferExists; }
// void SetWindowFramebuffer(uint8* fb) { _window_buffer = fb; }
void LockBuffer() { _buffer_locker->Lock(); } void LockBuffer() { _buffer_locker->Lock(); }
void UnlockBuffer() { _buffer_locker->Unlock(); } void UnlockBuffer() { _buffer_locker->Unlock(); }
void SetBufferDirty(bool bufferDirty) { _buffer_dirty = bufferDirty; } void SetBufferDirty(bool bufferDirty) { _buffer_dirty = bufferDirty; }
...@@ -575,27 +569,12 @@ private: ...@@ -575,27 +569,12 @@ private:
void _SetFullScreen(BMessage *msg) { void _SetFullScreen(BMessage *msg) {
bool fullscreen; bool fullscreen;
BRect rc1 = Bounds(),
rc2 = Frame();
printf(__FILE__": %d - bounds = (%.0f,%.0f,%.0f,%.0f), frame = (%.0f,%.0f,%.0f,%.0f\n", __LINE__, rc1.left, rc1.top, rc1.right, rc1.bottom,
rc2.left, rc2.top, rc2.right, rc2.bottom);
if( if(
msg->FindBool("fullscreen", &fullscreen) != B_OK msg->FindBool("fullscreen", &fullscreen) != B_OK
) { ) {
return; return;
} }
if(fullscreen) {
printf("Setting fullscreen...\n");
} else {
printf("Unsetting fullscreen...\n");
}
#if 1
SetFullScreen(fullscreen); SetFullScreen(fullscreen);
#endif
printf(__FILE__": %d - bounds = (%.0f,%.0f,%.0f,%.0f), frame = (%.0f,%.0f,%.0f,%.0f\n", __LINE__, rc1.left, rc1.top, rc1.right, rc1.bottom,
rc2.left, rc2.top, rc2.right, rc2.bottom);
} }
/* Members */ /* Members */
...@@ -615,7 +594,8 @@ rc2.left, rc2.top, rc2.right, rc2.bottom); ...@@ -615,7 +594,8 @@ rc2.left, rc2.top, rc2.right, rc2.bottom);
bool _connected, bool _connected,
_connection_disabled, _connection_disabled,
_buffer_created, _buffer_created,
_buffer_dirty; _buffer_dirty,
_trash_window_buffer;
uint8 *_bits; uint8 *_bits;
uint32 _row_bytes; uint32 _row_bytes;
clipping_rect _bounds; clipping_rect _bounds;
...@@ -623,11 +603,24 @@ rc2.left, rc2.top, rc2.right, rc2.bottom); ...@@ -623,11 +603,24 @@ rc2.left, rc2.top, rc2.right, rc2.bottom);
clipping_rect *_clips; clipping_rect *_clips;
int32 _num_clips; int32 _num_clips;
int32 _bytes_per_px; int32 _bytes_per_px;
// uint8 *_window_buffer; /* A copy of the window buffer */
bool _trash_window_buffer;
thread_id _draw_thread_id; thread_id _draw_thread_id;
BBitmap *_bitmap; BBitmap *_bitmap;
}; };
/* FIXME:
* An explanation of framebuffer flags.
*
* _connected - Original variable used to let the drawing thread know
* when changes are being made to the other framebuffer
* members.
* _connection_disabled - Used to signal to the drawing thread that the window
* is closing, and the thread should exit.
* _buffer_created - True if the current buffer is valid
* _buffer_dirty - True if the window should be redrawn.
* _trash_window_buffer - True if the window buffer needs to be trashed partway
* through a draw cycle. Occurs when the previous
* buffer provided by DirectConnected() is invalidated.
*/
#endif #endif
...@@ -35,7 +35,6 @@ extern "C" { ...@@ -35,7 +35,6 @@ extern "C" {
#endif #endif
int BE_SetClipboardText(_THIS, const char *text) { int BE_SetClipboardText(_THIS, const char *text) {
#if 0
BMessage *clip = NULL; BMessage *clip = NULL;
if(be_clipboard->Lock()) { if(be_clipboard->Lock()) {
be_clipboard->Clear(); be_clipboard->Clear();
...@@ -48,20 +47,17 @@ int BE_SetClipboardText(_THIS, const char *text) { ...@@ -48,20 +47,17 @@ int BE_SetClipboardText(_THIS, const char *text) {
} }
be_clipboard->Unlock(); be_clipboard->Unlock();
} }
#else
return -1;
#endif
} }
char *BE_GetClipboardText(_THIS) { char *BE_GetClipboardText(_THIS) {
#if 0
BMessage *clip = NULL; BMessage *clip = NULL;
const char *text; const char *text;
ssize_t length; ssize_t length;
if(be_clipboard->Lock()) { if(be_clipboard->Lock()) {
if((clip = be_clipboard->Data())) { if((clip = be_clipboard->Data())) {
/* Presumably the string of characters is ascii-format */ /* Presumably the string of characters is ascii-format */
clip->FindData("text/plain", B_MIME_TYPE, (void**)&text, &length); clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
&length);
} else { } else {
be_clipboard->Unlock(); be_clipboard->Unlock();
return NULL; return NULL;
...@@ -76,13 +72,9 @@ char *BE_GetClipboardText(_THIS) { ...@@ -76,13 +72,9 @@ char *BE_GetClipboardText(_THIS) {
SDL_strlcpy(result, text, length); SDL_strlcpy(result, text, length);
return result; return result;
#else
return NULL;
#endif;
} }
SDL_bool BE_HasClipboardText(_THIS) { SDL_bool BE_HasClipboardText(_THIS) {
#if 0
BMessage *clip = NULL; BMessage *clip = NULL;
const char *text; const char *text;
ssize_t length; ssize_t length;
...@@ -91,15 +83,13 @@ SDL_bool BE_HasClipboardText(_THIS) { ...@@ -91,15 +83,13 @@ SDL_bool BE_HasClipboardText(_THIS) {
if(be_clipboard->Lock()) { if(be_clipboard->Lock()) {
if((clip = be_clipboard->Data())) { if((clip = be_clipboard->Data())) {
/* Presumably the string of characters is ascii-format */ /* Presumably the string of characters is ascii-format */
clip->FindData("text/plain", B_MIME_TYPE, (void**)&text, &length); clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
&length);
if( text ) retval = SDL_TRUE; if( text ) retval = SDL_TRUE;
} }
be_clipboard->Unlock(); be_clipboard->Unlock();
} }
return retval; return retval;
#else
return SDL_FALSE;
#endif
} }
......
...@@ -26,6 +26,7 @@ extern "C" { ...@@ -26,6 +26,7 @@ extern "C" {
#endif #endif
void BE_PumpEvents(_THIS) { void BE_PumpEvents(_THIS) {
/* Since the event thread is its own thread, this isn't really necessary */
} }
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -126,9 +126,7 @@ int32 BE_DrawThread(void *data) { ...@@ -126,9 +126,7 @@ int32 BE_DrawThread(void *data) {
if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) { if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
bwin->LockBuffer(); bwin->LockBuffer();
BBitmap *bitmap = NULL; BBitmap *bitmap = NULL;
// while(!bitmap) { bitmap = bwin->GetBitmap();
bitmap = bwin->GetBitmap();
// }
int32 windowPitch = bitmap->BytesPerRow(); int32 windowPitch = bitmap->BytesPerRow();
int32 bufferPitch = bwin->GetRowBytes(); int32 bufferPitch = bwin->GetRowBytes();
uint8 *windowpx; uint8 *windowpx;
...@@ -163,14 +161,12 @@ int32 BE_DrawThread(void *data) { ...@@ -163,14 +161,12 @@ int32 BE_DrawThread(void *data) {
goto escape; /* Break out before the buffer is killed */ goto escape; /* Break out before the buffer is killed */
} }
// printf("memcpy(0x%x, 0x%x, %i) ", bufferpx, windowpx, width * BPP);
memcpy(bufferpx, windowpx, width * BPP); memcpy(bufferpx, windowpx, width * BPP);
bufferpx += bufferPitch; bufferpx += bufferPitch;
windowpx += windowPitch; windowpx += windowPitch;
} }
// printf("\t-\t");
} }
// printf("\n");
bwin->SetBufferDirty(false); bwin->SetBufferDirty(false);
escape: escape:
bwin->UnlockBuffer(); bwin->UnlockBuffer();
......
This diff is collapsed.
...@@ -45,6 +45,7 @@ static inline SDL_BApp *_GetBeApp() { ...@@ -45,6 +45,7 @@ static inline SDL_BApp *_GetBeApp() {
/* Passing a NULL path means load pointers from the application */ /* Passing a NULL path means load pointers from the application */
int BE_GL_LoadLibrary(_THIS, const char *path) int BE_GL_LoadLibrary(_THIS, const char *path)
{ {
/* FIXME: Is this working correctly? */
image_info info; image_info info;
int32 cookie = 0; int32 cookie = 0;
while (get_next_image_info(0, &cookie, &info) == B_OK) { while (get_next_image_info(0, &cookie, &info) == B_OK) {
...@@ -58,64 +59,6 @@ int BE_GL_LoadLibrary(_THIS, const char *path) ...@@ -58,64 +59,6 @@ int BE_GL_LoadLibrary(_THIS, const char *path)
SDL_arraysize(_this->gl_config.driver_path)); SDL_arraysize(_this->gl_config.driver_path));
} }
} }
#if 0
printf("\n\nLibrary loading: %s\n\n", path);
if (path == NULL) {
if (_this->gl_config.dll_handle == NULL) {
image_info info;
int32 cookie = 0;
while (get_next_image_info(0, &cookie, &info) == B_OK) {
printf(__FILE__": %d - Inside while\n",__LINE__);
void *location = NULL;
if (get_image_symbol
((image_id) cookie, "glBegin",
B_SYMBOL_TYPE_ANY, &location) == B_OK) {
_this->gl_config.dll_handle = (void *) cookie;
_this->gl_config.driver_loaded = 1;
SDL_strlcpy(_this->gl_config.driver_path,
"libGL.so",
SDL_arraysize(_this->
gl_config.driver_path));
}
}
}
} else {
/*
FIXME None of BeOS libGL.so implementations have exported functions
to load BGLView, which should be reloaded from new lib.
So for now just "load" linked libGL.so :(
*/
if (_this->gl_config.dll_handle == NULL) {
return BE_GL_LoadLibrary(_this, NULL);
}
/* Unload old first */
/*if (_this->gl_config.dll_handle != NULL) { */
/* Do not try to unload application itself (if LoadLibrary was called before with NULL ;) */
/* image_info info;
if (get_image_info((image_id)_this->gl_config.dll_handle, &info) == B_OK) {
if (info.type != B_APP_IMAGE) {
unload_add_on((image_id)_this->gl_config.dll_handle);
}
}
}
if ((_this->gl_config.dll_handle = (void*)load_add_on(path)) != (void*)B_ERROR) {
_this->gl_config.driver_loaded = 1;
SDL_strlcpy(_this->gl_config.driver_path, path, SDL_arraysize(_this->gl_config.driver_path));
} */
}
if (_this->gl_config.dll_handle != NULL) {
return 0;
} else {
printf(__FILE__": %d- gl_config.driver_loaded = 0\n", __LINE__);
_this->gl_config.dll_handle = NULL;
_this->gl_config.driver_loaded = 0;
*_this->gl_config.driver_path = '\0';
return -1;
}
#endif
} }
void *BE_GL_GetProcAddress(_THIS, const char *proc) void *BE_GL_GetProcAddress(_THIS, const char *proc)
...@@ -161,28 +104,29 @@ SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) { ...@@ -161,28 +104,29 @@ SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
void BE_GL_DeleteContext(_THIS, SDL_GLContext context) { void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
/* Currently, automatically unlocks the view */ /* Currently, automatically unlocks the view */
printf(__FILE__": %d\n", __LINE__);
((SDL_BWin*)context)->RemoveGLView(); ((SDL_BWin*)context)->RemoveGLView();
} }
int BE_GL_SetSwapInterval(_THIS, int interval) { int BE_GL_SetSwapInterval(_THIS, int interval) {
printf(__FILE__": %d- swap interval set\n", __LINE__); /* TODO: Implement this, if necessary? */
return 0; return 0;
} }
int BE_GL_GetSwapInterval(_THIS) { int BE_GL_GetSwapInterval(_THIS) {
printf(__FILE__": %d- swap interval requested\n", __LINE__); /* TODO: Implement this, if necessary? */
return 0; return 0;
} }
void BE_GL_UnloadLibrary(_THIS) { void BE_GL_UnloadLibrary(_THIS) {
printf(__FILE__": %d- Library unloaded\n", __LINE__); /* TODO: Implement this, if necessary? */
} }
/* FIXME: This function is meant to clear the OpenGL context when the video
mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not
currently in use. */
void BE_GL_RebootContexts(_THIS) { void BE_GL_RebootContexts(_THIS) {
SDL_Window *window = _this->windows; SDL_Window *window = _this->windows;
while(window) { while(window) {
......
...@@ -53,23 +53,11 @@ BE_CreateDevice(int devindex) ...@@ -53,23 +53,11 @@ BE_CreateDevice(int devindex)
/* Initialize all variables that we clean on shutdown */ /* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
#if 0
if (device) {
data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
} else {
data = NULL;
}
if (!data) {
SDL_OutOfMemory();
if (device) {
SDL_free(device);
}
return NULL;
}
#endif
device->driverdata = NULL; /*data;*/
/* TODO: Figure out what sort of initialization needs to go here */ device->driverdata = NULL; /* FIXME: Is this the cause of some of the
SDL_Quit() errors? */
/* TODO: Figure out if any initialization needs to go here */
/* Set the function pointers */ /* Set the function pointers */
device->VideoInit = BE_VideoInit; device->VideoInit = BE_VideoInit;
...@@ -105,7 +93,7 @@ BE_CreateDevice(int devindex) ...@@ -105,7 +93,7 @@ BE_CreateDevice(int devindex)
device->shape_driver.SetWindowShape = NULL; device->shape_driver.SetWindowShape = NULL;
device->shape_driver.ResizeWindowShape = NULL; device->shape_driver.ResizeWindowShape = NULL;
//#if SDL_VIDEO_OPENGL_WGL /* FIXME: Replace with BeOs's SDL OPENGL stuff */
device->GL_LoadLibrary = BE_GL_LoadLibrary; device->GL_LoadLibrary = BE_GL_LoadLibrary;
device->GL_GetProcAddress = BE_GL_GetProcAddress; device->GL_GetProcAddress = BE_GL_GetProcAddress;
device->GL_UnloadLibrary = BE_GL_UnloadLibrary; device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
...@@ -115,7 +103,7 @@ BE_CreateDevice(int devindex) ...@@ -115,7 +103,7 @@ BE_CreateDevice(int devindex)
device->GL_GetSwapInterval = BE_GL_GetSwapInterval; device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
device->GL_SwapWindow = BE_GL_SwapWindow; device->GL_SwapWindow = BE_GL_SwapWindow;
device->GL_DeleteContext = BE_GL_DeleteContext; device->GL_DeleteContext = BE_GL_DeleteContext;
//#endif
device->StartTextInput = BE_StartTextInput; device->StartTextInput = BE_StartTextInput;
device->StopTextInput = BE_StopTextInput; device->StopTextInput = BE_StopTextInput;
device->SetTextInputRect = BE_SetTextInputRect; device->SetTextInputRect = BE_SetTextInputRect;
...@@ -140,8 +128,6 @@ static void BE_DeleteDevice(SDL_VideoDevice * device) ...@@ -140,8 +128,6 @@ static void BE_DeleteDevice(SDL_VideoDevice * device)
SDL_free(device); SDL_free(device);
} }
/* FIXME: This is the 1.2 function at the moment. Read through it and
o understand what it does. */
int BE_VideoInit(_THIS) int BE_VideoInit(_THIS)
{ {
/* Initialize the Be Application for appserver interaction */ /* Initialize the Be Application for appserver interaction */
...@@ -162,9 +148,6 @@ int BE_VideoInit(_THIS) ...@@ -162,9 +148,6 @@ int BE_VideoInit(_THIS)
BE_GL_LoadLibrary(_this, NULL); BE_GL_LoadLibrary(_this, NULL);
#endif #endif
/* Fill in some window manager capabilities */
// _this->info.wm_available = 1;
/* We're done! */ /* We're done! */
return (0); return (0);
} }
...@@ -177,24 +160,8 @@ static int BE_Available(void) ...@@ -177,24 +160,8 @@ static int BE_Available(void)
void BE_VideoQuit(_THIS) void BE_VideoQuit(_THIS)
{ {
#if 0
SDL_Win->Quit();
SDL_Win = NULL;
#endif
#if 0
if (SDL_BlankCursor != NULL) {
BE_FreeWMCursor(_this, SDL_BlankCursor);
SDL_BlankCursor = NULL;
}
#endif
BE_QuitModes(_this); BE_QuitModes(_this);
#if SDL_VIDEO_OPENGL
// if (_this->gl_config.dll_handle != NULL)
// unload_add_on((image_id) _this->gl_config.dll_handle);
#endif
SDL_QuitBeApp(); SDL_QuitBeApp();
} }
......
...@@ -47,13 +47,17 @@ int _InitWindow(_THIS, SDL_Window *window) { ...@@ -47,13 +47,17 @@ int _InitWindow(_THIS, SDL_Window *window) {
); );
if(window->flags & SDL_WINDOW_FULLSCREEN) { if(window->flags & SDL_WINDOW_FULLSCREEN) {
/* TODO: Add support for this flag */
printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
} }
if(window->flags & SDL_WINDOW_OPENGL) { if(window->flags & SDL_WINDOW_OPENGL) {
/* TODO: Add support for this flag */
} }
if(!(window->flags & SDL_WINDOW_RESIZABLE)) { if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE; flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
} }
if(window->flags & SDL_WINDOW_BORDERLESS) { if(window->flags & SDL_WINDOW_BORDERLESS) {
/* TODO: Add support for this flag */
} }
SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, flags); SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, flags);
...@@ -172,10 +176,12 @@ void BE_SetWindowFullscreen(_THIS, SDL_Window * window, ...@@ -172,10 +176,12 @@ void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) { int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
/* FIXME: Not BeOs/Haiku supported */ /* FIXME: Not BeOs/Haiku supported */
return -1;
} }
int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) { int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
/* FIXME: Not BeOs/Haiku supported */ /* FIXME: Not BeOs/Haiku supported */
return -1;
} }
...@@ -193,6 +199,7 @@ void BE_DestroyWindow(_THIS, SDL_Window * window) { ...@@ -193,6 +199,7 @@ void BE_DestroyWindow(_THIS, SDL_Window * window) {
SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
struct SDL_SysWMinfo *info) { struct SDL_SysWMinfo *info) {
/* FIXME: What is the point of this? What information should be included? */ /* FIXME: What is the point of this? What information should be included? */
return SDL_FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment