|
@@ -21,6 +21,7 @@
|
|
|
|
|
|
|
|
#include "SDL_internal.h"
|
|
#include "SDL_internal.h"
|
|
|
#include "../SDL_sysvideo.h"
|
|
#include "../SDL_sysvideo.h"
|
|
|
|
|
+#include "../SDL_egl_c.h"
|
|
|
#include "../../events/SDL_keyboard_c.h"
|
|
#include "../../events/SDL_keyboard_c.h"
|
|
|
#include "../../events/SDL_mouse_c.h"
|
|
#include "../../events/SDL_mouse_c.h"
|
|
|
#include "../../events/SDL_windowevents_c.h"
|
|
#include "../../events/SDL_windowevents_c.h"
|
|
@@ -46,10 +47,8 @@ screen_event_t * getEvent()
|
|
|
* Initializes the QNX video plugin.
|
|
* Initializes the QNX video plugin.
|
|
|
* Creates the Screen context and event handles used for all window operations
|
|
* Creates the Screen context and event handles used for all window operations
|
|
|
* by the plugin.
|
|
* by the plugin.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @return true if successful, false on error
|
|
|
|
|
*/
|
|
*/
|
|
|
-static bool videoInit(SDL_VideoDevice *_this)
|
|
|
|
|
|
|
+static bool QNX_VideoInit(SDL_VideoDevice *_this)
|
|
|
{
|
|
{
|
|
|
SDL_VideoDisplay display;
|
|
SDL_VideoDisplay display;
|
|
|
SDL_DisplayData *display_data;
|
|
SDL_DisplayData *display_data;
|
|
@@ -163,7 +162,7 @@ static bool videoInit(SDL_VideoDevice *_this)
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void videoQuit(SDL_VideoDevice *_this)
|
|
|
|
|
|
|
+static void QNX_VideoQuit(SDL_VideoDevice *_this)
|
|
|
{
|
|
{
|
|
|
if (video_initialized) {
|
|
if (video_initialized) {
|
|
|
screen_destroy_event(event);
|
|
screen_destroy_event(event);
|
|
@@ -175,11 +174,8 @@ static void videoQuit(SDL_VideoDevice *_this)
|
|
|
/**
|
|
/**
|
|
|
* Creates a new native Screen window and associates it with the given SDL
|
|
* Creates a new native Screen window and associates it with the given SDL
|
|
|
* window.
|
|
* window.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window SDL window to initialize
|
|
|
|
|
- * @return true if successful, false on error
|
|
|
|
|
*/
|
|
*/
|
|
|
-static bool createWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
|
|
|
|
|
|
|
+static bool QNX_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
|
|
|
{
|
|
{
|
|
|
SDL_WindowData *impl;
|
|
SDL_WindowData *impl;
|
|
|
SDL_VideoDisplay *display = NULL;
|
|
SDL_VideoDisplay *display = NULL;
|
|
@@ -210,18 +206,15 @@ static bool createWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
|
|
|
position[0] = window->x;
|
|
position[0] = window->x;
|
|
|
position[1] = window->y;
|
|
position[1] = window->y;
|
|
|
|
|
|
|
|
- if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SIZE,
|
|
|
|
|
- size) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SIZE, size) < 0) {
|
|
|
goto fail;
|
|
goto fail;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SOURCE_SIZE,
|
|
|
|
|
- size) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SOURCE_SIZE, size) < 0) {
|
|
|
goto fail;
|
|
goto fail;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_POSITION,
|
|
|
|
|
- position) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_POSITION, position) < 0) {
|
|
|
goto fail;
|
|
goto fail;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -230,47 +223,47 @@ static bool createWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
|
|
|
SDL_assert(display->desktop_mode.internal != NULL);
|
|
SDL_assert(display->desktop_mode.internal != NULL);
|
|
|
display_mode_data = display->desktop_mode.internal;
|
|
display_mode_data = display->desktop_mode.internal;
|
|
|
|
|
|
|
|
- if (screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_FORMAT,
|
|
|
|
|
- &format) < 0) {
|
|
|
|
|
- format = display_mode_data->screen_format;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// Create window buffer(s).
|
|
// Create window buffer(s).
|
|
|
if (window->flags & SDL_WINDOW_OPENGL) {
|
|
if (window->flags & SDL_WINDOW_OPENGL) {
|
|
|
- if (!glInitConfig(impl, &format)) {
|
|
|
|
|
- goto fail;
|
|
|
|
|
- }
|
|
|
|
|
numbufs = 2;
|
|
numbufs = 2;
|
|
|
|
|
|
|
|
usage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_OPENGL_ES3;
|
|
usage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_OPENGL_ES3;
|
|
|
- if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_USAGE,
|
|
|
|
|
- &usage) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_USAGE, &usage) < 0) {
|
|
|
goto fail;
|
|
goto fail;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
numbufs = 1;
|
|
numbufs = 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Create buffer(s).
|
|
|
|
|
+ if (screen_create_window_buffers(impl->window, numbufs>0?numbufs:1) < 0) {
|
|
|
|
|
+ goto fail;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Initialize EGL surface.
|
|
|
|
|
+ if (window->flags & SDL_WINDOW_OPENGL) {
|
|
|
|
|
+ // The SDL_EGL_CreateSurface() function chooses the EGL config and
|
|
|
|
|
+ // assigns the window the corresponding format.
|
|
|
|
|
+ impl->egl_surface = SDL_EGL_CreateSurface(_this, window, (NativeWindowType)impl->window);
|
|
|
|
|
+ if (impl->egl_surface == EGL_NO_SURFACE) {
|
|
|
|
|
+ goto fail;
|
|
|
|
|
+ }
|
|
|
|
|
+ SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_QNX_SURFACE_POINTER, impl->egl_surface);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_FORMAT, &format) < 0) {
|
|
|
|
|
+ format = display_mode_data->screen_format;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// We now know what the pixel format is, so we need to provide it to the
|
|
// We now know what the pixel format is, so we need to provide it to the
|
|
|
// right SDL APIs.
|
|
// right SDL APIs.
|
|
|
display->desktop_mode.format = screenToPixelFormat(format);
|
|
display->desktop_mode.format = screenToPixelFormat(format);
|
|
|
display_mode_data->screen_format = format;
|
|
display_mode_data->screen_format = format;
|
|
|
|
|
|
|
|
display_data = display->internal;
|
|
display_data = display->internal;
|
|
|
- // Initialized in videoInit()
|
|
|
|
|
|
|
+ // Initialized in QNX_VideoInit()
|
|
|
SDL_assert(display_data != NULL);
|
|
SDL_assert(display_data != NULL);
|
|
|
|
|
|
|
|
- // Set pixel format.
|
|
|
|
|
- if (screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_FORMAT,
|
|
|
|
|
- &format) < 0) {
|
|
|
|
|
- goto fail;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Create buffer(s).
|
|
|
|
|
- if (screen_create_window_buffers(impl->window, numbufs>0?numbufs:1) < 0) {
|
|
|
|
|
- goto fail;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// Get initial focus state. Fallback to true.
|
|
// Get initial focus state. Fallback to true.
|
|
|
if(screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_FOCUS, &has_focus_i) < 0){
|
|
if(screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_FOCUS, &has_focus_i) < 0){
|
|
|
impl->has_focus = true;
|
|
impl->has_focus = true;
|
|
@@ -298,15 +291,9 @@ fail:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Gets a pointer to the Screen buffer associated with the given window. Note
|
|
* Gets a pointer to the Screen buffer associated with the given window. Note
|
|
|
- * that the buffer is actually created in createWindow().
|
|
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window SDL window to get the buffer for
|
|
|
|
|
- * @param[out] pixels Holds a pointer to the window's buffer
|
|
|
|
|
- * @param[out] format Holds the pixel format for the buffer
|
|
|
|
|
- * @param[out] pitch Holds the number of bytes per line
|
|
|
|
|
- * @return true if successful, false on error
|
|
|
|
|
|
|
+ * that the buffer is actually created in QNX_CreateWindow().
|
|
|
*/
|
|
*/
|
|
|
-static bool createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, SDL_PixelFormat * format,
|
|
|
|
|
|
|
+static bool QNX_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, SDL_PixelFormat * format,
|
|
|
void ** pixels, int *pitch)
|
|
void ** pixels, int *pitch)
|
|
|
{
|
|
{
|
|
|
int buffer_count;
|
|
int buffer_count;
|
|
@@ -314,26 +301,22 @@ static bool createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window,
|
|
|
screen_buffer_t *buffer;
|
|
screen_buffer_t *buffer;
|
|
|
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
|
|
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
|
|
|
|
|
|
|
|
- if (screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_BUFFER_COUNT,
|
|
|
|
|
- &buffer_count) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_BUFFER_COUNT, &buffer_count) < 0) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
buffer = SDL_calloc(buffer_count, sizeof(screen_buffer_t));
|
|
buffer = SDL_calloc(buffer_count, sizeof(screen_buffer_t));
|
|
|
|
|
|
|
|
// Get a pointer to the buffer's memory.
|
|
// Get a pointer to the buffer's memory.
|
|
|
- if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS,
|
|
|
|
|
- (void **)buffer) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS, (void **)buffer) < 0) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_get_buffer_property_pv(*buffer, SCREEN_PROPERTY_POINTER,
|
|
|
|
|
- pixels) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_buffer_property_pv(*buffer, SCREEN_PROPERTY_POINTER, pixels) < 0) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Set format and pitch.
|
|
// Set format and pitch.
|
|
|
- if (screen_get_buffer_property_iv(*buffer, SCREEN_PROPERTY_STRIDE,
|
|
|
|
|
- pitch) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_buffer_property_iv(*buffer, SCREEN_PROPERTY_STRIDE, pitch) < 0) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -343,27 +326,20 @@ static bool createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window,
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Informs the window manager that the window needs to be updated.
|
|
* Informs the window manager that the window needs to be updated.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window The window to update
|
|
|
|
|
- * @param rects An array of reectangular areas to update
|
|
|
|
|
- * @param numrects Rect array length
|
|
|
|
|
- * @return true if successful, false on error
|
|
|
|
|
*/
|
|
*/
|
|
|
-static bool updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects,
|
|
|
|
|
|
|
+static bool QNX_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects,
|
|
|
int numrects)
|
|
int numrects)
|
|
|
{
|
|
{
|
|
|
int buffer_count, *rects_int;
|
|
int buffer_count, *rects_int;
|
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
|
screen_buffer_t *buffer;
|
|
screen_buffer_t *buffer;
|
|
|
|
|
|
|
|
- if (screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_BUFFER_COUNT,
|
|
|
|
|
- &buffer_count) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_window_property_iv(impl->window, SCREEN_PROPERTY_BUFFER_COUNT, &buffer_count) < 0) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
buffer = SDL_calloc(buffer_count, sizeof(screen_buffer_t));
|
|
buffer = SDL_calloc(buffer_count, sizeof(screen_buffer_t));
|
|
|
|
|
|
|
|
- if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS,
|
|
|
|
|
- (void **)buffer) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS, (void **)buffer) < 0) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -387,10 +363,9 @@ static bool updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window,
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static SDL_FullscreenResult setWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen)
|
|
|
|
|
|
|
+static SDL_FullscreenResult QNX_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen)
|
|
|
{
|
|
{
|
|
|
SDL_WindowData *window_data = window->internal;
|
|
SDL_WindowData *window_data = window->internal;
|
|
|
- SDL_DisplayData *display_data = display->internal;
|
|
|
|
|
int size[2] = { 0, 0 };
|
|
int size[2] = { 0, 0 };
|
|
|
int position[2] = { 0, 0 };
|
|
int position[2] = { 0, 0 };
|
|
|
|
|
|
|
@@ -401,7 +376,7 @@ static SDL_FullscreenResult setWindowFullscreen(SDL_VideoDevice *_this, SDL_Wind
|
|
|
if (fullscreen) {
|
|
if (fullscreen) {
|
|
|
SDL_Rect bounds;
|
|
SDL_Rect bounds;
|
|
|
|
|
|
|
|
- if (!getDisplayBounds(_this, display, &bounds)) {
|
|
|
|
|
|
|
+ if (!QNX_GetDisplayBounds(_this, display, &bounds)) {
|
|
|
return SDL_FULLSCREEN_FAILED;
|
|
return SDL_FULLSCREEN_FAILED;
|
|
|
}
|
|
}
|
|
|
position[0] = bounds.x;
|
|
position[0] = bounds.x;
|
|
@@ -415,18 +390,15 @@ static SDL_FullscreenResult setWindowFullscreen(SDL_VideoDevice *_this, SDL_Wind
|
|
|
size[1] = window->h;
|
|
size[1] = window->h;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_set_window_property_iv(window_data->window, SCREEN_PROPERTY_SIZE,
|
|
|
|
|
- size) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(window_data->window, SCREEN_PROPERTY_SIZE, size) < 0) {
|
|
|
return SDL_FULLSCREEN_FAILED;
|
|
return SDL_FULLSCREEN_FAILED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_set_window_property_iv(window_data->window, SCREEN_PROPERTY_SOURCE_SIZE,
|
|
|
|
|
- size) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(window_data->window, SCREEN_PROPERTY_SOURCE_SIZE, size) < 0) {
|
|
|
return SDL_FULLSCREEN_FAILED;
|
|
return SDL_FULLSCREEN_FAILED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_set_window_property_iv(window_data->window, SCREEN_PROPERTY_POSITION,
|
|
|
|
|
- position) < 0) {
|
|
|
|
|
|
|
+ if (screen_set_window_property_iv(window_data->window, SCREEN_PROPERTY_POSITION, position) < 0) {
|
|
|
return SDL_FULLSCREEN_FAILED;
|
|
return SDL_FULLSCREEN_FAILED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -435,7 +407,7 @@ static SDL_FullscreenResult setWindowFullscreen(SDL_VideoDevice *_this, SDL_Wind
|
|
|
return SDL_FULLSCREEN_SUCCEEDED;
|
|
return SDL_FULLSCREEN_SUCCEEDED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static SDL_DisplayID getDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
+static SDL_DisplayID QNX_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
{
|
|
{
|
|
|
// We need this, otherwise SDL will fallback to the primary display, meaning
|
|
// We need this, otherwise SDL will fallback to the primary display, meaning
|
|
|
// any data we store about the display will be inconveniently overwritten.
|
|
// any data we store about the display will be inconveniently overwritten.
|
|
@@ -448,8 +420,7 @@ static SDL_DisplayID getDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *win
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_DISPLAY,
|
|
|
|
|
- (void **)&screen_display) < 0) {
|
|
|
|
|
|
|
+ if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_DISPLAY, (void **)&screen_display) < 0) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -465,9 +436,8 @@ static SDL_DisplayID getDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *win
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Runs the main event loop.
|
|
* Runs the main event loop.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
*/
|
|
*/
|
|
|
-static void pumpEvents(SDL_VideoDevice *_this)
|
|
|
|
|
|
|
+static void QNX_PumpEvents(SDL_VideoDevice *_this)
|
|
|
{
|
|
{
|
|
|
SDL_Window *window;
|
|
SDL_Window *window;
|
|
|
SDL_WindowData *impl;
|
|
SDL_WindowData *impl;
|
|
@@ -523,10 +493,8 @@ static void pumpEvents(SDL_VideoDevice *_this)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Updates the size of the native window using the geometry of the SDL window.
|
|
* Updates the size of the native window using the geometry of the SDL window.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window SDL window to update
|
|
|
|
|
*/
|
|
*/
|
|
|
-static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
+static void QNX_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
{
|
|
{
|
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
|
int size[2];
|
|
int size[2];
|
|
@@ -538,7 +506,7 @@ static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
if (screen_destroy_window_buffers(impl->window) < 0) {
|
|
if (screen_destroy_window_buffers(impl->window) < 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- impl->resize = 1;
|
|
|
|
|
|
|
+ impl->resize = true;
|
|
|
|
|
|
|
|
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SIZE, size);
|
|
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SIZE, size);
|
|
|
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SOURCE_SIZE, size);
|
|
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_SOURCE_SIZE, size);
|
|
@@ -551,38 +519,30 @@ static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Makes the native window associated with the given SDL window visible.
|
|
* Makes the native window associated with the given SDL window visible.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window SDL window to update
|
|
|
|
|
*/
|
|
*/
|
|
|
-static void showWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
+static void QNX_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
{
|
|
{
|
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
|
const int visible = 1;
|
|
const int visible = 1;
|
|
|
|
|
|
|
|
- screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE,
|
|
|
|
|
- &visible);
|
|
|
|
|
|
|
+ screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE, &visible);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Makes the native window associated with the given SDL window invisible.
|
|
* Makes the native window associated with the given SDL window invisible.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window SDL window to update
|
|
|
|
|
*/
|
|
*/
|
|
|
-static void hideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
+static void QNX_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
{
|
|
{
|
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
|
const int visible = 0;
|
|
const int visible = 0;
|
|
|
|
|
|
|
|
- screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE,
|
|
|
|
|
- &visible);
|
|
|
|
|
|
|
+ screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE, &visible);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Destroys the native window associated with the given SDL window.
|
|
* Destroys the native window associated with the given SDL window.
|
|
|
- * @param SDL_VideoDevice *_this
|
|
|
|
|
- * @param window SDL window that is being destroyed
|
|
|
|
|
*/
|
|
*/
|
|
|
-static void destroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
+static void QNX_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
{
|
|
{
|
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
SDL_WindowData *impl = (SDL_WindowData *)window->internal;
|
|
|
|
|
|
|
@@ -594,16 +554,14 @@ static void destroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Frees the plugin object created by createDevice().
|
|
* Frees the plugin object created by createDevice().
|
|
|
- * @param device Plugin object to free
|
|
|
|
|
*/
|
|
*/
|
|
|
-static void deleteDevice(SDL_VideoDevice *device)
|
|
|
|
|
|
|
+static void QNX_DeleteDevice(SDL_VideoDevice *device)
|
|
|
{
|
|
{
|
|
|
SDL_free(device);
|
|
SDL_free(device);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Creates the QNX video plugin used by SDL.
|
|
* Creates the QNX video plugin used by SDL.
|
|
|
- * @return Initialized device if successful, NULL otherwise
|
|
|
|
|
*/
|
|
*/
|
|
|
static SDL_VideoDevice *createDevice(void)
|
|
static SDL_VideoDevice *createDevice(void)
|
|
|
{
|
|
{
|
|
@@ -615,34 +573,35 @@ static SDL_VideoDevice *createDevice(void)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
device->internal = NULL;
|
|
device->internal = NULL;
|
|
|
- device->VideoInit = videoInit;
|
|
|
|
|
- device->VideoQuit = videoQuit;
|
|
|
|
|
- device->CreateSDLWindow = createWindow;
|
|
|
|
|
- device->CreateWindowFramebuffer = createWindowFramebuffer;
|
|
|
|
|
- device->UpdateWindowFramebuffer = updateWindowFramebuffer;
|
|
|
|
|
- device->SetWindowSize = setWindowSize;
|
|
|
|
|
- device->SetWindowFullscreen = setWindowFullscreen;
|
|
|
|
|
- device->ShowWindow = showWindow;
|
|
|
|
|
- device->HideWindow = hideWindow;
|
|
|
|
|
- device->GetDisplayForWindow = getDisplayForWindow;
|
|
|
|
|
- device->GetDisplayBounds = getDisplayBounds;
|
|
|
|
|
- device->GetDisplayModes = getDisplayModes;
|
|
|
|
|
|
|
+ device->VideoInit = QNX_VideoInit;
|
|
|
|
|
+ device->VideoQuit = QNX_VideoQuit;
|
|
|
|
|
+ device->CreateSDLWindow = QNX_CreateWindow;
|
|
|
|
|
+ device->CreateWindowFramebuffer = QNX_CreateWindowFramebuffer;
|
|
|
|
|
+ device->UpdateWindowFramebuffer = QNX_UpdateWindowFramebuffer;
|
|
|
|
|
+ device->SetWindowSize = QNX_SetWindowSize;
|
|
|
|
|
+ device->SetWindowFullscreen = QNX_SetWindowFullscreen;
|
|
|
|
|
+ device->ShowWindow = QNX_ShowWindow;
|
|
|
|
|
+ device->HideWindow = QNX_HideWindow;
|
|
|
|
|
+ device->GetDisplayForWindow = QNX_GetDisplayForWindow;
|
|
|
|
|
+ device->GetDisplayBounds = QNX_GetDisplayBounds;
|
|
|
|
|
+ device->GetDisplayModes = QNX_GetDisplayModes;
|
|
|
#if 0
|
|
#if 0
|
|
|
- device->SetDisplayMode = setDisplayMode;
|
|
|
|
|
|
|
+ device->SetDisplayMode = QNX_SetDisplayMode;
|
|
|
#endif
|
|
#endif
|
|
|
- device->PumpEvents = pumpEvents;
|
|
|
|
|
- device->DestroyWindow = destroyWindow;
|
|
|
|
|
-
|
|
|
|
|
- device->GL_LoadLibrary = glLoadLibrary;
|
|
|
|
|
- device->GL_GetProcAddress = glGetProcAddress;
|
|
|
|
|
- device->GL_CreateContext = glCreateContext;
|
|
|
|
|
- device->GL_SetSwapInterval = glSetSwapInterval;
|
|
|
|
|
- device->GL_SwapWindow = glSwapWindow;
|
|
|
|
|
- device->GL_MakeCurrent = glMakeCurrent;
|
|
|
|
|
- device->GL_DestroyContext = glDeleteContext;
|
|
|
|
|
- device->GL_UnloadLibrary = glUnloadLibrary;
|
|
|
|
|
-
|
|
|
|
|
- device->free = deleteDevice;
|
|
|
|
|
|
|
+ device->PumpEvents = QNX_PumpEvents;
|
|
|
|
|
+ device->DestroyWindow = QNX_DestroyWindow;
|
|
|
|
|
+
|
|
|
|
|
+ device->GL_LoadLibrary = QNX_GLES_LoadLibrary;
|
|
|
|
|
+ device->GL_GetProcAddress = QNX_GLES_GetProcAddress;
|
|
|
|
|
+ device->GL_CreateContext = QNX_GLES_CreateContext;
|
|
|
|
|
+ device->GL_SetSwapInterval = QNX_GLES_SetSwapInterval;
|
|
|
|
|
+ device->GL_GetSwapInterval = QNX_GLES_GetSwapInterval;
|
|
|
|
|
+ device->GL_SwapWindow = QNX_GLES_SwapWindow;
|
|
|
|
|
+ device->GL_MakeCurrent = QNX_GLES_MakeCurrent;
|
|
|
|
|
+ device->GL_DestroyContext = QNX_GLES_DeleteContext;
|
|
|
|
|
+ device->GL_UnloadLibrary = QNX_GLES_UnloadLibrary;
|
|
|
|
|
+
|
|
|
|
|
+ device->free = QNX_DeleteDevice;
|
|
|
|
|
|
|
|
return device;
|
|
return device;
|
|
|
}
|
|
}
|