SDL_BApp Class Reference

`#include <SDL_BApp.h>`

Inheritance diagram for SDL_BApp:
[legend]
Collaboration diagram for SDL_BApp:
[legend]

## Public Member Functions

| SDL_BApp (const char *signature)
virtual | ~SDL_BApp ()
virtual void | MessageReceived (BMessage *message)
int32 | GetID (SDL_Window *win)
void | ClearID (SDL_BWin *bwin)
SDL_Window * | GetSDLWindow (int32 winID)
void | SetCurrentContext (BGLView *newContext)

## Private Member Functions

void | _HandleBasicWindowEvent (BMessage *msg, int32 sdlEventType)
void | _HandleMouseMove (BMessage *msg)
void | _HandleMouseButton (BMessage *msg)
void | _HandleMouseWheel (BMessage *msg)
void | _HandleKey (BMessage *msg)
void | _HandleMouseFocus (BMessage *msg)
void | _HandleKeyboardFocus (BMessage *msg)
void | _HandleWindowMoved (BMessage *msg)
void | _HandleWindowResized (BMessage *msg)
bool | _GetWinID (BMessage *msg, int32 *winID)
void | _SetSDLWindow (SDL_Window *win, int32 winID)
int32 | _GetNumWindowSlots ()
void | _PopBackWindow ()
void | _PushBackWindow (SDL_Window *win)

## Private Attributes

std::vector< SDL_Window * > | _window_map
BGLView * | _current_context

## Detailed Description

Definition at line 81 of file SDL_BApp.h.

## Constructor & Destructor Documentation

## SDL_BApp()

SDL_BApp::SDL_BApp | ( | const char * | signature | ) |

inline

Definition at line 83 of file SDL_BApp.h.

References _current_context, and NULL.

:
BApplication(signature) {
#if SDL_VIDEO_OPENGL
_current_context = NULL;
#endif
}
NULL
#define NULL
Definition: begin_code.h:164
SDL_BApp::_current_context
BGLView * _current_context
Definition: SDL_BApp.h:395

## ~SDL_BApp()

virtual SDL_BApp::~SDL_BApp | ( |  | ) |

inline virtual

Definition at line 91 of file SDL_BApp.h.

{
}

## Member Function Documentation

## _GetNumWindowSlots()

int32 SDL_BApp::_GetNumWindowSlots | ( |  | ) |

inline private

Definition at line 377 of file SDL_BApp.h.

References _window_map.

Referenced by GetID().

{
return _window_map.size();
}
SDL_BApp::_window_map
std::vector< SDL_Window * > _window_map
Definition: SDL_BApp.h:392

## _GetWinID()

bool SDL_BApp::_GetWinID | ( | BMessage * | msg,
|  | int32 * | winID
| ) |  |

inline private

Definition at line 365 of file SDL_BApp.h.

Referenced by _HandleBasicWindowEvent(), _HandleKeyboardFocus(), _HandleMouseButton(), _HandleMouseFocus(), _HandleMouseMove(), _HandleMouseWheel(), _HandleWindowMoved(), and _HandleWindowResized().

{
return msg->FindInt32("window-id", winID) == B_OK;
}

## _HandleBasicWindowEvent()

void SDL_BApp::_HandleBasicWindowEvent | ( | BMessage * | msg,
|  | int32 | sdlEventType
| ) |  |

inline private

Definition at line 207 of file SDL_BApp.h.

References _GetWinID(), GetSDLWindow(), and SDL_SendWindowEvent().

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
if(
!_GetWinID(msg, &winID)
) {
return;
}
win = GetSDLWindow(winID);
SDL_SendWindowEvent(win, sdlEventType, 0, 0);
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
SDL_SendWindowEvent
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
Definition: SDL_windowevents.c:88
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73

## _HandleKey()

void SDL_BApp::_HandleKey | ( | BMessage * | msg | ) |

inline private

Definition at line 267 of file SDL_BApp.h.

References BE_GetKeyState(), BE_GetScancodeFromBeKey(), BE_SetKeyState(), SDL_EventState, SDL_memcpy, SDL_PRESSED, SDL_QUERY, SDL_SendKeyboardKey(), SDL_SendKeyboardText(), SDL_TEXTINPUT, SDL_TEXTINPUTEVENT_TEXT_SIZE, SDL_zero, state, and text.

Referenced by MessageReceived().

{
int32 scancode, state; /* scancode, pressed/released */
if(
msg->FindInt32("key-state", &state) != B_OK ||
msg->FindInt32("key-scancode", &scancode) != B_OK
) {
return;
}
/* Make sure this isn't a repeated event (key pressed and held) */
if(state == SDL_PRESSED && BE_GetKeyState(scancode) == SDL_PRESSED) {
return;
}
BE_SetKeyState(scancode, state);
SDL_SendKeyboardKey(state, BE_GetScancodeFromBeKey(scancode));
if (state == SDL_PRESSED && SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
const int8 *keyUtf8;
ssize_t count;
if (msg->FindData("key-utf8", B_INT8_TYPE, (const void**)&keyUtf8, &count) == B_OK) {
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
SDL_zero(text);
SDL_memcpy(text, keyUtf8, count);
SDL_SendKeyboardText(text);
}
}
}
count
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
BE_SetKeyState
void BE_SetKeyState(int32 bkey, int8 state)
SDL_SendKeyboardKey
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
Definition: SDL_keyboard.c:679
SDL_memcpy
#define SDL_memcpy
Definition: SDL_dynapi_overrides.h:387
SDL_SendKeyboardText
int SDL_SendKeyboardText(const char *text)
Definition: SDL_keyboard.c:789
SDL_zero
#define SDL_zero(x)
Definition: SDL_stdinc.h:416
BE_GetScancodeFromBeKey
SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey)
BE_GetKeyState
int8 BE_GetKeyState(int32 bkey)
text
static char text[MAX_TEXT_LENGTH]
Definition: testime.c:47
SDL_TEXTINPUT
Definition: SDL_events.h:96
SDL_EventState
#define SDL_EventState
Definition: SDL_dynapi_overrides.h:131
SDL_TEXTINPUTEVENT_TEXT_SIZE
#define SDL_TEXTINPUTEVENT_TEXT_SIZE
Definition: SDL_events.h:217
SDL_PRESSED
#define SDL_PRESSED
Definition: SDL_events.h:50
SDL_QUERY
#define SDL_QUERY
Definition: SDL_events.h:719

## _HandleKeyboardFocus()

void SDL_BApp::_HandleKeyboardFocus | ( | BMessage * | msg | ) |

inline private

Definition at line 314 of file SDL_BApp.h.

References _GetWinID(), GetSDLWindow(), NULL, SDL_GetKeyboardFocus, and SDL_SetKeyboardFocus().

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
bool bSetFocus; /* If false, lose focus */
if(
!_GetWinID(msg, &winID) ||
msg->FindBool("focusGained", &bSetFocus) != B_OK
) {
return;
}
win = GetSDLWindow(winID);
if(bSetFocus) {
SDL_SetKeyboardFocus(win);
} else if(SDL_GetKeyboardFocus() == win) {
/* Only lose all focus if this window was the current focus */
SDL_SetKeyboardFocus(NULL);
}
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
SDL_SetKeyboardFocus
void SDL_SetKeyboardFocus(SDL_Window *window)
Definition: SDL_keyboard.c:630
SDL_GetKeyboardFocus
#define SDL_GetKeyboardFocus
Definition: SDL_dynapi_overrides.h:216
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
NULL
#define NULL
Definition: begin_code.h:164
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73

## _HandleMouseButton()

void SDL_BApp::_HandleMouseButton | ( | BMessage * | msg | ) |

inline private

Definition at line 237 of file SDL_BApp.h.

References _GetWinID(), button, GetSDLWindow(), SDL_SendMouseButton(), and state.

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
int32 button, state; /* left/middle/right, pressed/released */
if(
!_GetWinID(msg, &winID) ||
msg->FindInt32("button-id", &button) != B_OK ||
msg->FindInt32("button-state", &state) != B_OK
) {
return;
}
win = GetSDLWindow(winID);
SDL_SendMouseButton(win, 0, state, button);
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
button
SDL_Texture * button
Definition: testgamecontroller.c:67
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_SendMouseButton
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
Definition: SDL_mouse.c:506

## _HandleMouseFocus()

void SDL_BApp::_HandleMouseFocus | ( | BMessage * | msg | ) |

inline private

Definition at line 295 of file SDL_BApp.h.

References _GetWinID(), GetSDLWindow(), NULL, SDL_GetMouseFocus, and SDL_SetMouseFocus().

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
bool bSetFocus; /* If false, lose focus */
if(
!_GetWinID(msg, &winID) ||
msg->FindBool("focusGained", &bSetFocus) != B_OK
) {
return;
}
win = GetSDLWindow(winID);
if(bSetFocus) {
SDL_SetMouseFocus(win);
} else if(SDL_GetMouseFocus() == win) {
/* Only lose all focus if this window was the current focus */
SDL_SetMouseFocus(NULL);
}
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
SDL_SetMouseFocus
void SDL_SetMouseFocus(SDL_Window *window)
Definition: SDL_mouse.c:151
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
NULL
#define NULL
Definition: begin_code.h:164
SDL_GetMouseFocus
#define SDL_GetMouseFocus
Definition: SDL_dynapi_overrides.h:245
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73

## _HandleMouseMove()

void SDL_BApp::_HandleMouseMove | ( | BMessage * | msg | ) |

inline private

Definition at line 219 of file SDL_BApp.h.

References _GetWinID(), BE_UpdateWindowFramebuffer(), GetSDLWindow(), NULL, and SDL_SendMouseMotion().

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
int32 x = 0, y = 0;
if(
!_GetWinID(msg, &winID) ||
msg->FindInt32("x", &x) != B_OK || /* x movement */
msg->FindInt32("y", &y) != B_OK /* y movement */
) {
return;
}
win = GetSDLWindow(winID);
SDL_SendMouseMotion(win, 0, 0, x, y);
/* Tell the application that the mouse passed over, redraw needed */
BE_UpdateWindowFramebuffer(NULL,win,NULL,-1);
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDL_SendMouseMotion
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
Definition: SDL_mouse.c:237
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
BE_UpdateWindowFramebuffer
int BE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
NULL
#define NULL
Definition: begin_code.h:164
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73

## _HandleMouseWheel()

void SDL_BApp::_HandleMouseWheel | ( | BMessage * | msg | ) |

inline private

Definition at line 252 of file SDL_BApp.h.

References _GetWinID(), GetSDLWindow(), SDL_MOUSEWHEEL_NORMAL, and SDL_SendMouseWheel().

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
int32 xTicks, yTicks;
if(
!_GetWinID(msg, &winID) ||
msg->FindInt32("xticks", &xTicks) != B_OK ||
msg->FindInt32("yticks", &yTicks) != B_OK
) {
return;
}
win = GetSDLWindow(winID);
SDL_SendMouseWheel(win, 0, xTicks, yTicks, SDL_MOUSEWHEEL_NORMAL);
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
SDL_MOUSEWHEEL_NORMAL
Definition: SDL_mouse.h:68
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
SDL_SendMouseWheel
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction)
Definition: SDL_mouse.c:512
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73

## _HandleWindowMoved()

void SDL_BApp::_HandleWindowMoved | ( | BMessage * | msg | ) |

inline private

Definition at line 333 of file SDL_BApp.h.

References _GetWinID(), GetSDLWindow(), SDL_SendWindowEvent(), and SDL_WINDOWEVENT_MOVED.

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
int32 xPos, yPos;
/* Get the window id and new x/y position of the window */
if(
!_GetWinID(msg, &winID) ||
msg->FindInt32("window-x", &xPos) != B_OK ||
msg->FindInt32("window-y", &yPos) != B_OK
) {
return;
}
win = GetSDLWindow(winID);
SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos);
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
SDL_SendWindowEvent
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
Definition: SDL_windowevents.c:88
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_WINDOWEVENT_MOVED
Definition: SDL_video.h:153

## _HandleWindowResized()

void SDL_BApp::_HandleWindowResized | ( | BMessage * | msg | ) |

inline private

Definition at line 349 of file SDL_BApp.h.

References _GetWinID(), GetSDLWindow(), SDL_SendWindowEvent(), and SDL_WINDOWEVENT_RESIZED.

Referenced by MessageReceived().

{
SDL_Window *win;
int32 winID;
int32 w, h;
/* Get the window id ]and new x/y position of the window */
if(
!_GetWinID(msg, &winID) ||
msg->FindInt32("window-w", &w) != B_OK ||
msg->FindInt32("window-h", &h) != B_OK
) {
return;
}
win = GetSDLWindow(winID);
SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h);
}
SDL_BApp::_GetWinID
bool _GetWinID(BMessage *msg, int32 *winID)
Definition: SDL_BApp.h:365
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946
SDL_SendWindowEvent
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
Definition: SDL_windowevents.c:88
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_WINDOWEVENT_RESIZED
Definition: SDL_video.h:155

## _PopBackWindow()

void SDL_BApp::_PopBackWindow | ( |  | ) |

inline private

Definition at line 382 of file SDL_BApp.h.

References _window_map.

{
_window_map.pop_back();
}
SDL_BApp::_window_map
std::vector< SDL_Window * > _window_map
Definition: SDL_BApp.h:392

## _PushBackWindow()

void SDL_BApp::_PushBackWindow | ( | SDL_Window * | win | ) |

inline private

Definition at line 386 of file SDL_BApp.h.

References _window_map.

Referenced by GetID().

{
_window_map.push_back(win);
}
SDL_BApp::_window_map
std::vector< SDL_Window * > _window_map
Definition: SDL_BApp.h:392

## _SetSDLWindow()

void SDL_BApp::_SetSDLWindow | ( | SDL_Window * | win,
|  | int32 | winID
| ) |  |

inline private

Definition at line 373 of file SDL_BApp.h.

References _window_map.

Referenced by GetID().

{
_window_map[winID] = win;
}
SDL_BApp::_window_map
std::vector< SDL_Window * > _window_map
Definition: SDL_BApp.h:392

## ClearID()

void SDL_BApp::ClearID | ( | SDL_BWin * | bwin | ) |

Referenced by GetID().

## GetID()

int32 SDL_BApp::GetID | ( | SDL_Window * | win | ) |

inline

Definition at line 167 of file SDL_BApp.h.

References _GetNumWindowSlots(), _PushBackWindow(), _SetSDLWindow(), ClearID(), GetSDLWindow(), i, and NULL.

{
int32 i;
for(i = 0; i < _GetNumWindowSlots(); ++i) {
if( GetSDLWindow(i) == NULL ) {
_SetSDLWindow(win, i);
return i;
}
}
/* Expand the vector if all slots are full */
if( i == _GetNumWindowSlots() ) {
_PushBackWindow(win);
return i;
}
/* TODO: error handling */
return 0;
}
SDL_BApp::_GetNumWindowSlots
int32 _GetNumWindowSlots()
Definition: SDL_BApp.h:377
SDL_BApp::_SetSDLWindow
void _SetSDLWindow(SDL_Window *win, int32 winID)
Definition: SDL_BApp.h:373
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_BApp::GetSDLWindow
SDL_Window * GetSDLWindow(int32 winID)
Definition: SDL_BApp.h:191
NULL
#define NULL
Definition: begin_code.h:164
SDL_BApp::_PushBackWindow
void _PushBackWindow(SDL_Window *win)
Definition: SDL_BApp.h:386

## GetSDLWindow()

SDL_Window* SDL_BApp::GetSDLWindow | ( | int32 | winID | ) |

inline

Definition at line 191 of file SDL_BApp.h.

References _window_map.

Referenced by _HandleBasicWindowEvent(), _HandleKeyboardFocus(), _HandleMouseButton(), _HandleMouseFocus(), _HandleMouseMove(), _HandleMouseWheel(), _HandleWindowMoved(), _HandleWindowResized(), and GetID().

{
return _window_map[winID];
}
SDL_BApp::_window_map
std::vector< SDL_Window * > _window_map
Definition: SDL_BApp.h:392

## MessageReceived()

virtual void SDL_BApp::MessageReceived | ( | BMessage * | message | ) |

inline virtual

Definition at line 97 of file SDL_BApp.h.

References _HandleBasicWindowEvent(), _HandleKey(), _HandleKeyboardFocus(), _HandleMouseButton(), _HandleMouseFocus(), _HandleMouseMove(), _HandleMouseWheel(), _HandleWindowMoved(), _HandleWindowResized(), BAPP_HIDE, BAPP_KEY, BAPP_KEYBOARD_FOCUS, BAPP_MAXIMIZE, BAPP_MINIMIZE, BAPP_MOUSE_BUTTON, BAPP_MOUSE_FOCUS, BAPP_MOUSE_MOVED, BAPP_MOUSE_WHEEL, BAPP_REPAINT, BAPP_SCREEN_CHANGED, BAPP_SHOW, BAPP_WINDOW_CLOSE_REQUESTED, BAPP_WINDOW_MOVED, BAPP_WINDOW_RESIZED, SDL_WINDOWEVENT_CLOSE, SDL_WINDOWEVENT_EXPOSED, SDL_WINDOWEVENT_HIDDEN, SDL_WINDOWEVENT_MAXIMIZED, SDL_WINDOWEVENT_MINIMIZED, and SDL_WINDOWEVENT_SHOWN.

{
/* Sort out SDL-related messages */
switch ( message->what ) {
case BAPP_MOUSE_MOVED:
_HandleMouseMove(message);
break;
case BAPP_MOUSE_BUTTON:
_HandleMouseButton(message);
break;
case BAPP_MOUSE_WHEEL:
_HandleMouseWheel(message);
break;
case BAPP_KEY:
_HandleKey(message);
break;
case BAPP_REPAINT:
_HandleBasicWindowEvent(message, SDL_WINDOWEVENT_EXPOSED);
break;
case BAPP_MAXIMIZE:
_HandleBasicWindowEvent(message, SDL_WINDOWEVENT_MAXIMIZED);
break;
case BAPP_MINIMIZE:
_HandleBasicWindowEvent(message, SDL_WINDOWEVENT_MINIMIZED);
break;
case BAPP_SHOW:
_HandleBasicWindowEvent(message, SDL_WINDOWEVENT_SHOWN);
break;
case BAPP_HIDE:
_HandleBasicWindowEvent(message, SDL_WINDOWEVENT_HIDDEN);
break;
case BAPP_MOUSE_FOCUS:
_HandleMouseFocus(message);
break;
case BAPP_KEYBOARD_FOCUS:
_HandleKeyboardFocus(message);
break;
case BAPP_WINDOW_CLOSE_REQUESTED:
_HandleBasicWindowEvent(message, SDL_WINDOWEVENT_CLOSE);
break;
case BAPP_WINDOW_MOVED:
_HandleWindowMoved(message);
break;
case BAPP_WINDOW_RESIZED:
_HandleWindowResized(message);
break;
case BAPP_SCREEN_CHANGED:
/* TODO: Handle screen resize or workspace change */
break;
default:
BApplication::MessageReceived(message);
break;
}
}
BAPP_HIDE
Definition: SDL_BApp.h:69
BAPP_SCREEN_CHANGED
Definition: SDL_BApp.h:75
BAPP_SHOW
Definition: SDL_BApp.h:68
BAPP_WINDOW_MOVED
Definition: SDL_BApp.h:73
SDL_BApp::_HandleMouseButton
void _HandleMouseButton(BMessage *msg)
Definition: SDL_BApp.h:237
SDL_WINDOWEVENT_MINIMIZED
Definition: SDL_video.h:159
BAPP_MOUSE_WHEEL
Definition: SDL_BApp.h:61
message
GLuint GLsizei const GLchar * message
Definition: SDL_opengl_glext.h:2483
BAPP_WINDOW_RESIZED
Definition: SDL_BApp.h:74
SDL_BApp::_HandleWindowMoved
void _HandleWindowMoved(BMessage *msg)
Definition: SDL_BApp.h:333
BAPP_MOUSE_BUTTON
Definition: SDL_BApp.h:60
SDL_WINDOWEVENT_MAXIMIZED
Definition: SDL_video.h:160
BAPP_MAXIMIZE
Definition: SDL_BApp.h:65
SDL_BApp::_HandleKeyboardFocus
void _HandleKeyboardFocus(BMessage *msg)
Definition: SDL_BApp.h:314
BAPP_KEY
Definition: SDL_BApp.h:62
SDL_WINDOWEVENT_HIDDEN
Definition: SDL_video.h:150
SDL_BApp::_HandleMouseFocus
void _HandleMouseFocus(BMessage *msg)
Definition: SDL_BApp.h:295
BAPP_REPAINT
Definition: SDL_BApp.h:63
SDL_BApp::_HandleMouseMove
void _HandleMouseMove(BMessage *msg)
Definition: SDL_BApp.h:219
BAPP_MOUSE_MOVED
Definition: SDL_BApp.h:59
BAPP_MOUSE_FOCUS
Definition: SDL_BApp.h:70
SDL_BApp::_HandleKey
void _HandleKey(BMessage *msg)
Definition: SDL_BApp.h:267
SDL_WINDOWEVENT_CLOSE
Definition: SDL_video.h:167
BAPP_KEYBOARD_FOCUS
Definition: SDL_BApp.h:71
SDL_WINDOWEVENT_SHOWN
Definition: SDL_video.h:149
BAPP_MINIMIZE
Definition: SDL_BApp.h:66
BAPP_WINDOW_CLOSE_REQUESTED
Definition: SDL_BApp.h:72
SDL_WINDOWEVENT_EXPOSED
Definition: SDL_video.h:151
SDL_BApp::_HandleBasicWindowEvent
void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType)
Definition: SDL_BApp.h:207
SDL_BApp::_HandleWindowResized
void _HandleWindowResized(BMessage *msg)
Definition: SDL_BApp.h:349
SDL_BApp::_HandleMouseWheel
void _HandleMouseWheel(BMessage *msg)
Definition: SDL_BApp.h:252

## SetCurrentContext()

void SDL_BApp::SetCurrentContext | ( | BGLView * | newContext | ) |

inline

Definition at line 196 of file SDL_BApp.h.

References _current_context.

{
if(_current_context)
_current_context->UnlockGL();
_current_context = newContext;
if (_current_context)
_current_context->LockGL();
}
SDL_BApp::_current_context
BGLView * _current_context
Definition: SDL_BApp.h:395

## Field Documentation

## _current_context

BGLView* SDL_BApp::_current_context

private

Definition at line 395 of file SDL_BApp.h.

Referenced by SDL_BApp(), and SetCurrentContext().

## _window_map

std::vector<SDL_Window*> SDL_BApp::_window_map

private

Definition at line 392 of file SDL_BApp.h.

Referenced by _GetNumWindowSlots(), _PopBackWindow(), _PushBackWindow(), _SetSDLWindow(), and GetSDLWindow().

The documentation for this class was generated from the following file:

- src/main/haiku/SDL_BApp.h