Commit a47948aa authored by Sam Lantinga's avatar Sam Lantinga

Nobody is currently maintaining the QNX code, so removing it for now.

parent 09a85588
...@@ -13,7 +13,7 @@ level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, ...@@ -13,7 +13,7 @@ level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms. and 2D framebuffer across multiple platforms.
The current version supports Windows, Windows CE, Mac OS X, Linux, FreeBSD, The current version supports Windows, Windows CE, Mac OS X, Linux, FreeBSD,
NetBSD, OpenBSD, BSD/OS, Solaris, QNX, iOS, and Android. The code contains NetBSD, OpenBSD, BSD/OS, Solaris, iOS, and Android. The code contains
support for other operating systems but those are not officially supported. support for other operating systems but those are not officially supported.
SDL is written in C, but works with C++ natively, and has bindings to SDL is written in C, but works with C++ natively, and has bindings to
......
...@@ -30,5 +30,4 @@ Pandora - maintained by Scott Smith <pickle136@sbcglobal.net> ...@@ -30,5 +30,4 @@ Pandora - maintained by Scott Smith <pickle136@sbcglobal.net>
Platforms that need maintainers Platforms that need maintainers
=============================== ===============================
Nintendo DS Nintendo DS
QNX
Haiku Haiku
README.QNX by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
Last changed at 10 Jun 2009.
QNX Photon and GF drivers are being constructed, OpenGL ES support is
finished. Still no 2D renderer support in GF and Photon drivers.
QNX QSA (QNX Sound Architecture) driver is ready.
QNX HID input driver is finished.
----------------------
-- SDL QSA driver --
----------------------
Due to QNX Sound Architecture limitations software could not determine
what playback channels are designed for, so some casus can be. For example,
output after testmultiaudio test utility execution:
Using audio driver: qsa
playing on device #0: ('Vortex 8820 @ fb000000 d0')...done.
playing on device #1: ('Vortex 8820 @ fb000000 d1')...done.
playing on device #2: ('i8x0 @ d800 d0')...done.
playing on device #3: ('i8x0 @ d800 d1')...done.
playing on all devices...
Open device 3 failed: QSA: snd_pcm_channel_params failed: Invalid argument
If speakers are connected to both audio cards: Vortex 8820 and Intel
Integrated Audio we can hear sound playback on device #0 and devices #2, #3
only. Device #1 is an unknown PCM channel which does not produce any sound.
As for error during device #3 opening, it's caused by QSA software mixer
channel, because it can't open real hardware device #2, since it's already
opened by SDL.
After simultaneous sound playback on all devices utility testmultiaudio
stays running waiting for sound playback finish on device #1, which is
locked up due to some Aureal Vortex 8820 driver limitations.
---------------------
-- SDL GF driver --
---------------------
Here is an additional information about SDL GF driver:
* 0. Introduction.
* 1. Environment variables which SDL GF driver supports.
* 2. Custom video modes.
* 3. Limitations.
0. Introduction.
SDL GF driver is a layer between SDL and QNX Graphics Framework (GF).
SDL GF driver also supports OpenGL ES through the QNX Graphics Framework.
Hardware accelerated features which SDL can support depend on real hardware
capabilities.
1. Environment variables which GF driver supports.
GF driver supports the following environment variables for QNX GF
specific customization options:
a) SDL_VIDEO_GF_REFRESH_RATE - refresh rate of video output in Hz.
Without this environment variable declaration SDL controls refresh
rate of your display. If this enironment variable is set to 0, SDL
will control refresh rate of display, otherwise value of flag
SDL_VIDEO_GF_REFRESH_RATE is used for all screen resolutions as
refresh rate. This example will set 60Hz refresh rate as refresh rate
for all graphics modes:
export SDL_VIDEO_GF_REFRESH_RATE=60
2. Custom video modes.
Since most QNX graphics drivers support GENERIC video modes, i.e. you
can specify any horizontal and vertical resolution and any refresh rate,
SDL GF driver uses its own fullscreen modes list, which can be incomplete.
You can add any custom video mode, which your QNX graphics driver supports
by editing file ./src/video/qnxgf/SDL_qnxgf.c. Custom graphics mode
definition looks like this:
{0, 1024, 640, 60, NULL}, /* 1024x640 mode is 60Hz only */
You must specify horizontal resolution as the second parameter, vertical
resolution as the third one and refresh rate as the fourth parameter.
Please leave the first and the last parameters as 0 and NULL. Then send me
your changes to e-mail address which is specified in the header of this
document.
3. Limitations.
There are few limitations while using SDL GF driver:
a) Since GF driver supports fullscreen modes only, when flag
SDL_WINDOW_FULLSCREEN is not specified, SDL GF driver will try to find the
fullscreen graphics mode which corresponds to SDL window size. Refresh rate
will be the lowest available, if SDL_VIDEO_GF_REFRESH_RATE environment
variable is not set.
b) As confirmed by QSSL none of existing video drivers has support of
doublescan low-resolution video modes. So modes below 640x480 are not
supported. If your video driver supports low-resolution video modes, please
add SDL_GF_LOWRESOLUTION flag to the gf_devicename array in the SDL_qnxgf.c
source file.
c) Since GF framework supports hardware mouse cursor only, you'll get
hardware mouse cursor in case of specific graphics driver supports it.
-------------------------
-- SDL Photon driver --
-------------------------
----------------------------
-- SDL HID input driver --
----------------------------
...@@ -1326,70 +1326,6 @@ AC_HELP_STRING([--enable-video-x11-xdamage-xfixes], [enable X11 Xdamage and Xfix ...@@ -1326,70 +1326,6 @@ AC_HELP_STRING([--enable-video-x11-xdamage-xfixes], [enable X11 Xdamage and Xfix
fi fi
} }
dnl Check for QNX photon video driver
CheckPHOTON()
{
AC_ARG_ENABLE(video-photon,
AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
, enable_video_photon=yes)
if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
AC_MSG_CHECKING(for QNX Photon support)
video_photon=no
AC_TRY_COMPILE([
#include <Ph.h>
#include <Pt.h>
#include <photon/Pg.h>
#include <photon/PdDirect.h>
],[
PgDisplaySettings_t *visual;
],[
video_photon=yes
])
AC_MSG_RESULT($video_photon)
if test x$video_photon = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph -lphrender"
have_video=yes
CheckOpenGLQNX
fi
fi
}
dnl Check for QNX photon video driver
CheckQNXGF()
{
AC_ARG_ENABLE(video-qnxgf,
AC_HELP_STRING([--enable-video-qnxgf], [use QNX GF video driver [[default=yes]]]),
, enable_video_qnxgf=yes)
if test x$enable_video = xyes -a x$enable_video_qnxgf = xyes; then
AC_MSG_CHECKING(for QNX GF support)
video_qnxgf=no
AC_TRY_COMPILE([
#include <gf/gf.h>
#include <gf/gf3d.h>
],[
gf_3d_config_info_t* gfinfo;
],[
video_qnxgf=yes
])
AC_MSG_RESULT($video_qnxgf)
if test x$video_qnxgf = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_QNXGF)
SOURCES="$SOURCES $srcdir/src/video/qnxgf/*.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgf"
# Add HIDDI library for HID support using GF
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lhiddi"
have_video=yes
CheckOpenGLESQNX
fi
fi
}
dnl Set up the BWindow video driver if enabled dnl Set up the BWindow video driver if enabled
CheckBWINDOW() CheckBWINDOW()
{ {
...@@ -1594,65 +1530,6 @@ CheckOpenGLX11() ...@@ -1594,65 +1530,6 @@ CheckOpenGLX11()
fi fi
} }
dnl Find QNX 6.x Software OpenGL
CheckOpenGLQNX()
{
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
AC_MSG_CHECKING(for QNX 6.x Photon OpenGL support)
video_opengl=no
AC_TRY_COMPILE([
#include <GL/gl.h>
],[
],[
video_opengl=yes
])
AC_MSG_RESULT($video_opengl)
if test x$video_opengl = xyes; then
AC_DEFINE(SDL_VIDEO_OPENGL)
AC_DEFINE(SDL_VIDEO_RENDER_OGL)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
fi
fi
}
dnl Find QNX 6.3 and above OpenGL ES implementation
CheckOpenGLESQNX()
{
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
AC_MSG_CHECKING(for QNX OpenGL ES (CM) support)
video_opengl=no
AC_TRY_COMPILE([
#include <GLES/egl.h>
],[
],[
video_opengl=yes
])
AC_MSG_RESULT($video_opengl)
if test x$video_opengl = xyes; then
AC_DEFINE(SDL_VIDEO_OPENGL_ES)
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGLES_CM"
else
AC_MSG_CHECKING(for QNX OpenGL ES (CL) support)
video_opengl=no
AC_TRY_COMPILE([
#define COMMON_LITE
#include <GLES/egl.h>
],[
],[
video_opengl=yes
])
AC_MSG_RESULT($video_opengl)
if test x$video_opengl = xyes; then
AC_DEFINE(SDL_VIDEO_OPENGL_ES)
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGLES_CLS"
fi
fi
fi
}
dnl Check for Windows OpenGL dnl Check for Windows OpenGL
CheckWINDOWSGL() CheckWINDOWSGL()
{ {
...@@ -1796,10 +1673,6 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) ...@@ -1796,10 +1673,6 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]])
pthread_cflags="-D_REENTRANT" pthread_cflags="-D_REENTRANT"
pthread_lib="-L/usr/lib -lpthread" pthread_lib="-L/usr/lib -lpthread"
;; ;;
*-*-qnx*)
pthread_cflags=""
pthread_lib=""
;;
*-*-osf*) *-*-osf*)
pthread_cflags="-D_REENTRANT" pthread_cflags="-D_REENTRANT"
if test x$ac_cv_prog_gcc = xyes; then if test x$ac_cv_prog_gcc = xyes; then
...@@ -2287,54 +2160,6 @@ case "$host" in ...@@ -2287,54 +2160,6 @@ case "$host" in
have_timers=yes have_timers=yes
fi fi
;; ;;
*-*-qnx*)
EXTRA_CFLAGS="-I/usr/include $CFLAGS"
EXTRA_LDLAGS="-L/usr/lib $LDFLAGS"
ARCH=qnx
CheckVisibilityHidden
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
CheckDLOPEN
CheckPulseAudio
CheckESD
CheckNAS
CheckPHOTON
CheckQNXGF
CheckX11
CheckOpenGLX11
CheckPTHREAD
CheckClockGettime
# Set up files for the audio library
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_QSA)
SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
have_audio=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
AC_DEFINE(SDL_TIMER_UNIX)
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes
fi
# Set up dummy files for the joystick for now
if test x$enable_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_DUMMY)
SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
have_joystick=yes
fi
# Set up dummy files for the haptic for now
if test x$enable_haptic = xyes; then
AC_DEFINE(SDL_HAPTIC_DUMMY)
SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
have_haptic=yes
fi
;;
*-wince* | *-mingw32ce) *-wince* | *-mingw32ce)
ARCH=win32 ARCH=win32
CheckDummyVideo CheckDummyVideo
......
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
* level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, * level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
* and 2D framebuffer across multiple platforms. * and 2D framebuffer across multiple platforms.
* *
* The current version supports Windows, Windows CE, Mac OS X, Linux,
* FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, and QNX. The code contains
* support for other operating systems but those are not officially supported.
*
* SDL is written in C, but works with C++ natively, and has bindings to * SDL is written in C, but works with C++ natively, and has bindings to
* several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, * several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
* Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, * Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
......
...@@ -261,8 +261,6 @@ ...@@ -261,8 +261,6 @@
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
#undef SDL_VIDEO_DRIVER_DUMMY #undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_NDS #undef SDL_VIDEO_DRIVER_NDS
#undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_QNXGF
#undef SDL_VIDEO_DRIVER_WINDOWS #undef SDL_VIDEO_DRIVER_WINDOWS
#undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
......
...@@ -211,9 +211,6 @@ GL_SetError(const char *prefix, GLenum result) ...@@ -211,9 +211,6 @@ GL_SetError(const char *prefix, GLenum result)
static int static int
GL_LoadFunctions(GL_RenderData * data) GL_LoadFunctions(GL_RenderData * data)
{ {
#if defined(__QNXNTO__) && (_NTO_VERSION < 630)
#define __SDL_NOGETPROCADDR__
#endif
#ifdef __SDL_NOGETPROCADDR__ #ifdef __SDL_NOGETPROCADDR__
#define SDL_PROC(ret,func,params) data->func=func; #define SDL_PROC(ret,func,params) data->func=func;
#else #else
......
...@@ -30,14 +30,7 @@ ...@@ -30,14 +30,7 @@
#include "SDL_rect_c.h" #include "SDL_rect_c.h"
#include "SDL_yuv_sw_c.h" #include "SDL_yuv_sw_c.h"
#if defined(__QNXNTO__) #if defined(SDL_VIDEO_DRIVER_PANDORA)
/* Include QNX system header to check QNX version later */
#include <sys/neutrino.h>
#endif /* __QNXNTO__ */
#if defined(SDL_VIDEO_DRIVER_QNXGF) || \
defined(SDL_VIDEO_DRIVER_PHOTON) || \
defined(SDL_VIDEO_DRIVER_PANDORA)
/* Empty function stub to get OpenGL ES 1.x support without */ /* Empty function stub to get OpenGL ES 1.x support without */
/* OpenGL ES extension GL_OES_draw_texture supported */ /* OpenGL ES extension GL_OES_draw_texture supported */
...@@ -47,7 +40,7 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) ...@@ -47,7 +40,7 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
return; return;
} }
#endif /* QNXGF || PHOTON || PANDORA */ #endif /* PANDORA */
/* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
...@@ -229,16 +222,6 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) ...@@ -229,16 +222,6 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
renderer->info.flags = SDL_RENDERER_ACCELERATED; renderer->info.flags = SDL_RENDERER_ACCELERATED;
#if defined(__QNXNTO__)
#if _NTO_VERSION<=641
/* QNX's OpenGL ES implementation is broken regarding */
/* packed textures support, affected versions 6.3.2, 6.4.0, 6.4.1 */
renderer->info.num_texture_formats = 2;
renderer->info.texture_formats[0] = SDL_PIXELFORMAT_ABGR8888;
renderer->info.texture_formats[1] = SDL_PIXELFORMAT_BGR24;
#endif /* _NTO_VERSION */
#endif /* __QNXNTO__ */
if (GLES_LoadFunctions(data) < 0) { if (GLES_LoadFunctions(data) < 0) {
GLES_DestroyRenderer(renderer); GLES_DestroyRenderer(renderer);
return NULL; return NULL;
......
...@@ -397,30 +397,21 @@ extern VideoBootStrap WINDOWS_bootstrap; ...@@ -397,30 +397,21 @@ extern VideoBootStrap WINDOWS_bootstrap;
#if SDL_VIDEO_DRIVER_BWINDOW #if SDL_VIDEO_DRIVER_BWINDOW
extern VideoBootStrap BWINDOW_bootstrap; extern VideoBootStrap BWINDOW_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_PHOTON #if SDL_VIDEO_DRIVER_PANDORA
extern VideoBootStrap photon_bootstrap; extern VideoBootStrap PND_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_QNXGF
extern VideoBootStrap qnxgf_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_EPOC
extern VideoBootStrap EPOC_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_UIKIT
extern VideoBootStrap UIKIT_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_DUMMY
extern VideoBootStrap DUMMY_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_NDS #if SDL_VIDEO_DRIVER_NDS
extern VideoBootStrap NDS_bootstrap; extern VideoBootStrap NDS_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_PANDORA #if SDL_VIDEO_DRIVER_UIKIT
extern VideoBootStrap PND_bootstrap; extern VideoBootStrap UIKIT_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_ANDROID #if SDL_VIDEO_DRIVER_ANDROID
extern VideoBootStrap Android_bootstrap; extern VideoBootStrap Android_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_DUMMY
extern VideoBootStrap DUMMY_bootstrap;
#endif
#define SDL_CurrentDisplay (&_this->displays[_this->current_display]) #define SDL_CurrentDisplay (&_this->displays[_this->current_display])
......
...@@ -70,14 +70,8 @@ static VideoBootStrap *bootstrap[] = { ...@@ -70,14 +70,8 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_BWINDOW #if SDL_VIDEO_DRIVER_BWINDOW
&BWINDOW_bootstrap, &BWINDOW_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_PHOTON #if SDL_VIDEO_DRIVER_PANDORA
&photon_bootstrap, &PND_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_QNXGF
&qnxgf_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_EPOC
&EPOC_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_NDS #if SDL_VIDEO_DRIVER_NDS
&NDS_bootstrap, &NDS_bootstrap,
...@@ -85,14 +79,11 @@ static VideoBootStrap *bootstrap[] = { ...@@ -85,14 +79,11 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_UIKIT #if SDL_VIDEO_DRIVER_UIKIT
&UIKIT_bootstrap, &UIKIT_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_DUMMY
&DUMMY_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_PANDORA
&PND_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_ANDROID #if SDL_VIDEO_DRIVER_ANDROID
&Android_bootstrap, &Android_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DUMMY
&DUMMY_bootstrap,
#endif #endif
NULL NULL
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Photon GUI SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_PHOTON_H__
#define __SDL_PHOTON_H__
/* GF headers must be included first for the Photon GF functions */
#if defined(SDL_VIDEO_OPENGL_ES)
#include <gf/gf.h>
#include <GLES/egl.h>
#endif /* SDL_VIDEO_OPENGL_ES */
#include "SDL_config.h"
#include "../SDL_sysvideo.h"
#include <Ph.h>
#include <Pt.h>
#include <photon/PkKeyDef.h>
/* Maximum display devices, which can handle SDL Photon driver */
#define SDL_VIDEO_PHOTON_MAX_RIDS 16
typedef struct SDL_VideoData
{
PhRid_t rid[SDL_VIDEO_PHOTON_MAX_RIDS];
uint32_t avail_rids;
uint32_t current_device_id;
#if defined(SDL_VIDEO_OPENGL_ES)
gf_dev_t gfdev; /* GF device handle */
gf_dev_info_t gfdev_info; /* GF device information */
SDL_bool gfinitialized; /* GF device initialization status */
EGLDisplay egldisplay; /* OpenGL ES display connection */
uint32_t egl_refcount; /* OpenGL ES reference count */
uint32_t swapinterval; /* OpenGL ES default swap interval */
EGLContext lgles_context; /* Last used OpenGL ES context */
EGLSurface lgles_surface; /* Last used OpenGL ES target surface */
#endif /* SDL_VIDEO_OPENGL_ES */
} SDL_VideoData;
/* This is hardcoded value in photon/Pg.h */
#define SDL_VIDEO_PHOTON_DEVICENAME_MAX 41
#define SDL_VIDEO_PHOTON_MAX_CURSOR_SIZE 128
/* Maximum event message size with data payload */
#define SDL_VIDEO_PHOTON_EVENT_SIZE 8192
/* Current video mode graphics capabilities */
#define SDL_VIDEO_PHOTON_CAP_ALPHA_BLEND 0x00000001
#define SDL_VIDEO_PHOTON_CAP_SCALED_BLIT 0x00000002
typedef struct SDL_DisplayData
{
uint32_t device_id;
uint32_t custom_refresh; /* Custom refresh rate for all modes */
SDL_DisplayMode current_mode; /* Current video mode */
uint8_t description[SDL_VIDEO_PHOTON_DEVICENAME_MAX];
/* Device description */
uint32_t caps; /* Device capabilities */
PhCursorDef_t *cursor; /* Global cursor settings */
SDL_bool cursor_visible; /* SDL_TRUE if cursor visible */
uint32_t cursor_size; /* Cursor size in memory w/ structure */
uint32_t mode_2dcaps; /* Current video mode 2D capabilities */
SDL_bool direct_mode; /* Direct mode state */
#if defined(SDL_VIDEO_OPENGL_ES)
gf_display_t display; /* GF display handle */
gf_display_info_t display_info; /* GF display information */
#endif /* SDL_VIDEO_OPENGL_ES */
} SDL_DisplayData;
/* Maximum amount of OpenGL ES framebuffer configurations */
#define SDL_VIDEO_GF_OPENGLES_CONFS 32
typedef struct SDL_WindowData
{
SDL_bool uses_gles; /* if true window must support OpenGL ES */
PtWidget_t *window; /* window handle */
#if defined(SDL_VIDEO_OPENGL_ES)
EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS];
/* OpenGL ES framebuffer confs */
EGLint gles_config; /* OpenGL ES configuration index */
EGLContext gles_context; /* OpenGL ES context */
EGLint gles_attributes[256]; /* OpenGL ES attributes for context */
EGLSurface gles_surface; /* OpenGL ES target rendering surface */
gf_surface_t gfsurface; /* OpenGL ES GF's surface */
PdOffscreenContext_t *phsurface; /* OpenGL ES Photon's surface */
#endif /* SDL_VIDEO_OPENGL_ES */
} SDL_WindowData;
/****************************************************************************/
/* Low level Photon graphics driver capabilities */
/****************************************************************************/
typedef struct Photon_DeviceCaps
{
uint8_t *name;
uint32_t caps;
} Photon_DeviceCaps;
#define SDL_PHOTON_UNACCELERATED 0x00000000
#define SDL_PHOTON_ACCELERATED 0x00000001
#define SDL_PHOTON_UNACCELERATED_3D 0x00000000
#define SDL_PHOTON_ACCELERATED_3D 0x00000004
/****************************************************************************/
/* SDL_VideoDevice functions declaration */
/****************************************************************************/
/* Display and window functions */
int photon_videoinit(_THIS);
void photon_videoquit(_THIS);
void photon_getdisplaymodes(_THIS);
int photon_setdisplaymode(_THIS, SDL_DisplayMode * mode);
int photon_setdisplaygammaramp(_THIS, Uint16 * ramp);
int photon_getdisplaygammaramp(_THIS, Uint16 * ramp);
int photon_createwindow(_THIS, SDL_Window * window);
int photon_createwindowfrom(_THIS, SDL_Window * window, const void *data);
void photon_setwindowtitle(_THIS, SDL_Window * window);
void photon_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
void photon_setwindowposition(_THIS, SDL_Window * window);
void photon_setwindowsize(_THIS, SDL_Window * window);
void photon_showwindow(_THIS, SDL_Window * window);
void photon_hidewindow(_THIS, SDL_Window * window);
void photon_raisewindow(_THIS, SDL_Window * window);
void photon_maximizewindow(_THIS, SDL_Window * window);
void photon_minimizewindow(_THIS, SDL_Window * window);
void photon_restorewindow(_THIS, SDL_Window * window);
void photon_setwindowgrab(_THIS, SDL_Window * window);
void photon_destroywindow(_THIS, SDL_Window * window);
/* Window manager function */
SDL_bool photon_getwindowwminfo(_THIS, SDL_Window * window,
struct SDL_SysWMinfo *info);
/* OpenGL/OpenGL ES functions */
int photon_gl_loadlibrary(_THIS, const char *path);
void *photon_gl_getprocaddres(_THIS, const char *proc);
void photon_gl_unloadlibrary(_THIS);
SDL_GLContext photon_gl_createcontext(_THIS, SDL_Window * window);
int photon_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
int photon_gl_setswapinterval(_THIS, int interval);
int photon_gl_getswapinterval(_THIS);
void photon_gl_swapwindow(_THIS, SDL_Window * window);
void photon_gl_deletecontext(_THIS, SDL_GLContext context);
/* Helper function, which re-creates surface, not an API */
int photon_gl_recreatesurface(_THIS, SDL_Window * window, uint32_t width, uint32_t height);
/* Event handling function */
void photon_pumpevents(_THIS);
/* Screen saver related function */
void photon_suspendscreensaver(_THIS);
#endif /* __SDL_PHOTON_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Photon GUI SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_PHOTON_INPUT_H__
#define __SDL_PHOTON_INPUT_H__
#include "SDL_config.h"
#include "SDL_video.h"
#include "../SDL_sysvideo.h"
#include "SDL_photon.h"
typedef struct SDL_MouseData
{
SDL_DisplayData *didata;
} SDL_MouseData;
int32_t photon_addinputdevices(_THIS);
int32_t photon_delinputdevices(_THIS);
#define SDL_PHOTON_MOUSE_COLOR_BLACK 0xFF000000
#define SDL_PHOTON_MOUSE_COLOR_WHITE 0xFFFFFFFF
#define SDL_PHOTON_MOUSE_COLOR_TRANS 0x00000000
SDL_ScanCode photon_to_sdl_keymap(uint32_t key);
#endif /* __SDL_GF_INPUT_H__ */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Photon GUI SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_PHOTON_KEYCODES_H__
#define __SDL_PHOTON_KEYCODES_H__
#define PHOTON_SCANCODE_ESCAPE 0x01
#define PHOTON_SCANCODE_F1 0x3B
#define PHOTON_SCANCODE_F2 0x3C
#define PHOTON_SCANCODE_F3 0x3D
#define PHOTON_SCANCODE_F4 0x3E
#define PHOTON_SCANCODE_F5 0x3F
#define PHOTON_SCANCODE_F6 0x40
#define PHOTON_SCANCODE_F7 0x41
#define PHOTON_SCANCODE_F8 0x42
#define PHOTON_SCANCODE_F9 0x43
#define PHOTON_SCANCODE_F10 0x44
#define PHOTON_SCANCODE_F11 0x57
#define PHOTON_SCANCODE_F12 0x58
#define PHOTON_SCANCODE_BACKQOUTE 0x29
#define PHOTON_SCANCODE_1 0x02
#define PHOTON_SCANCODE_2 0x03
#define PHOTON_SCANCODE_3 0x04
#define PHOTON_SCANCODE_4 0x05
#define PHOTON_SCANCODE_5 0x06
#define PHOTON_SCANCODE_6 0x07
#define PHOTON_SCANCODE_7 0x08
#define PHOTON_SCANCODE_8 0x09
#define PHOTON_SCANCODE_9 0x0A
#define PHOTON_SCANCODE_0 0x0B
#define PHOTON_SCANCODE_MINUS 0x0C
#define PHOTON_SCANCODE_EQUAL 0x0D
#define PHOTON_SCANCODE_BACKSPACE 0x0E
#define PHOTON_SCANCODE_TAB 0x0F
#define PHOTON_SCANCODE_Q 0x10
#define PHOTON_SCANCODE_W 0x11
#define PHOTON_SCANCODE_E 0x12
#define PHOTON_SCANCODE_R 0x13
#define PHOTON_SCANCODE_T 0x14
#define PHOTON_SCANCODE_Y 0x15
#define PHOTON_SCANCODE_U 0x16
#define PHOTON_SCANCODE_I 0x17
#define PHOTON_SCANCODE_O 0x18
#define PHOTON_SCANCODE_P 0x19
#define PHOTON_SCANCODE_LEFT_SQ_BR 0x1A
#define PHOTON_SCANCODE_RIGHT_SQ_BR 0x1B
#define PHOTON_SCANCODE_ENTER 0x1C
#define PHOTON_SCANCODE_CAPSLOCK 0x3A
#define PHOTON_SCANCODE_A 0x1E
#define PHOTON_SCANCODE_S 0x1F
#define PHOTON_SCANCODE_D 0x20
#define PHOTON_SCANCODE_F 0x21
#define PHOTON_SCANCODE_G 0x22
#define PHOTON_SCANCODE_H 0x23
#define PHOTON_SCANCODE_J 0x24
#define PHOTON_SCANCODE_K 0x25
#define PHOTON_SCANCODE_L 0x26
#define PHOTON_SCANCODE_SEMICOLON 0x27
#define PHOTON_SCANCODE_QUOTE 0x28
#define PHOTON_SCANCODE_BACKSLASH 0x2B
#define PHOTON_SCANCODE_LEFT_SHIFT 0x2A
#define PHOTON_SCANCODE_Z 0x2C
#define PHOTON_SCANCODE_X 0x2D
#define PHOTON_SCANCODE_C 0x2E
#define PHOTON_SCANCODE_V 0x2F
#define PHOTON_SCANCODE_B 0x30
#define PHOTON_SCANCODE_N 0x31
#define PHOTON_SCANCODE_M 0x32
#define PHOTON_SCANCODE_COMMA 0x33
#define PHOTON_SCANCODE_POINT 0x34
#define PHOTON_SCANCODE_SLASH 0x35
#define PHOTON_SCANCODE_RIGHT_SHIFT 0x36
#define PHOTON_SCANCODE_CTRL 0x1D
#define PHOTON_SCANCODE_WFLAG 0x5B
#define PHOTON_SCANCODE_ALT 0x38
#define PHOTON_SCANCODE_SPACE 0x39
#define PHOTON_SCANCODE_MENU 0x5D
#define PHOTON_SCANCODE_PRNSCR 0x54 /* only key pressed event, no release */
#define PHOTON_SCANCODE_SCROLLLOCK 0x46
#if 0 /* pause doesn't generates a scancode */
#define PHOTON_SCANCODE_PAUSE 0x??
#endif
#define PHOTON_SCANCODE_INSERT 0x52
#define PHOTON_SCANCODE_HOME 0x47
#define PHOTON_SCANCODE_PAGEUP 0x49
#define PHOTON_SCANCODE_DELETE 0x53
#define PHOTON_SCANCODE_END 0x4F
#define PHOTON_SCANCODE_PAGEDOWN 0x51
#define PHOTON_SCANCODE_UP 0x48
#define PHOTON_SCANCODE_DOWN 0x50
#define PHOTON_SCANCODE_LEFT 0x4B
#define PHOTON_SCANCODE_RIGHT 0x4D
#define PHOTON_SCANCODE_NUMLOCK 0x45
#endif /* __SDL_PHOTON_KEYCODES_H__ */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Photon GUI SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#include "SDL_photon_pixelfmt.h"
uint32_t
photon_bits_to_sdl_pixelformat(uint32_t pixelfmt)
{
switch (pixelfmt) {
case 8:
{
return SDL_PIXELFORMAT_INDEX8;
}
break;
case 15:
{
return SDL_PIXELFORMAT_ARGB1555;
}
break;
case 16:
{
return SDL_PIXELFORMAT_RGB565;
}
break;
case 24:
{
return SDL_PIXELFORMAT_RGB888;
}
break;
case 32:
{
return SDL_PIXELFORMAT_ARGB8888;
}
break;
}
}
uint32_t
photon_sdl_to_bits_pixelformat(uint32_t pixelfmt)
{
switch (pixelfmt) {
case SDL_PIXELFORMAT_INDEX8:
{
return 8;
}
break;
case SDL_PIXELFORMAT_ARGB1555:
{
return 15;
}
break;
case SDL_PIXELFORMAT_RGB555:
{
return 15;
}
break;
case SDL_PIXELFORMAT_ABGR1555:
{
return 15;
}
break;
case SDL_PIXELFORMAT_RGB565:
{
return 16;
}
break;
case SDL_PIXELFORMAT_RGB24:
{
return 24;
}
break;
case SDL_PIXELFORMAT_RGB888:
{
return 32;
}
break;
case SDL_PIXELFORMAT_BGRA8888:
{
return 32;
}
break;
case SDL_PIXELFORMAT_ARGB8888:
{
return 32;
}
break;
case SDL_PIXELFORMAT_YV12:
{
return 8;
}
break;
case SDL_PIXELFORMAT_YUY2:
{
return 16;
}
break;
case SDL_PIXELFORMAT_UYVY:
{
return 16;
}
break;
case SDL_PIXELFORMAT_YVYU:
{
return 16;
}
break;
}
return 0;
}
uint32_t
photon_image_to_sdl_pixelformat(uint32_t pixelfmt)
{
switch (pixelfmt) {
case Pg_IMAGE_PALETTE_BYTE:
{
return SDL_PIXELFORMAT_INDEX8;
}
break;
case Pg_IMAGE_DIRECT_8888:
{
return SDL_PIXELFORMAT_ARGB8888;
}
break;
case Pg_IMAGE_DIRECT_888:
{
return SDL_PIXELFORMAT_RGB24;
}
break;
case Pg_IMAGE_DIRECT_565:
{
return SDL_PIXELFORMAT_RGB565;
}
break;
case Pg_IMAGE_DIRECT_555:
{
return SDL_PIXELFORMAT_RGB555;
}
break;
case Pg_IMAGE_DIRECT_1555:
{
return SDL_PIXELFORMAT_ARGB1555;
}
break;
}
return 0;
}
uint32_t
photon_sdl_to_image_pixelformat(uint32_t pixelfmt)
{
switch (pixelfmt) {
case SDL_PIXELFORMAT_INDEX8:
{
return Pg_IMAGE_PALETTE_BYTE;
}
break;
case SDL_PIXELFORMAT_ARGB8888:
{
return Pg_IMAGE_DIRECT_8888;
}
break;
case SDL_PIXELFORMAT_RGB888:
{
return Pg_IMAGE_DIRECT_8888;
}
break;
case SDL_PIXELFORMAT_RGB24:
{
return Pg_IMAGE_DIRECT_888;
}
break;
case SDL_PIXELFORMAT_RGB565:
{
return Pg_IMAGE_DIRECT_565;
}
break;
case SDL_PIXELFORMAT_ARGB1555:
{
return Pg_IMAGE_DIRECT_1555;
}
break;
case SDL_PIXELFORMAT_RGB555:
{
return Pg_IMAGE_DIRECT_555;
}
break;
}
return 0;
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Photon GUI SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#include "SDL_config.h"
#include "../SDL_sysvideo.h"
#include <Ph.h>
#ifndef __SDL_PHOTON_PIXELFMT_H__
#define __SDL_PHOTON_PIXELFMT_H__
uint32_t photon_bits_to_sdl_pixelformat(uint32_t pixelfmt);
uint32_t photon_sdl_to_bits_pixelformat(uint32_t pixelfmt);
uint32_t photon_image_to_sdl_pixelformat(uint32_t pixelfmt);
uint32_t photon_sdl_to_image_pixelformat(uint32_t pixelfmt);
#endif /* __SDL_PHOTON_PIXELFMT_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Photon GUI SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_PHOTON_RENDER_H__
#define __SDL_PHOTON_RENDER_H__
#include "../SDL_sysvideo.h"
#include <Ph.h>
#include <photon/PhRender.h>
#define SDL_PHOTON_MAX_SURFACES 3
#define SDL_PHOTON_SURFTYPE_UNKNOWN 0x00000000
#define SDL_PHOTON_SURFTYPE_OFFSCREEN 0x00000001
#define SDL_PHOTON_SURFTYPE_PHIMAGE 0x00000002
#define SDL_PHOTON_UNKNOWN_BLEND 0x00000000
#define SDL_PHOTON_DRAW_BLEND 0x00000001
#define SDL_PHOTON_TEXTURE_BLEND 0x00000002
typedef struct SDL_RenderData
{
SDL_bool enable_vsync; /* VSYNC flip synchronization enable */
uint32_t surface_visible_idx; /* Index of visible surface */
uint32_t surface_render_idx; /* Index of render surface */
uint32_t surfaces_count; /* Amount of allocated surfaces */
uint32_t surfaces_type; /* Type of allocated surfaces */
uint32_t window_width; /* Last active window width */
uint32_t window_height; /* Last active window height */
PhGC_t* gc; /* Graphics context */
SDL_bool direct_mode; /* Direct Mode state */
PdOffscreenContext_t* osurfaces[SDL_PHOTON_MAX_SURFACES];
PhImage_t* psurfaces[SDL_PHOTON_MAX_SURFACES];
PmMemoryContext_t* pcontexts[SDL_PHOTON_MAX_SURFACES];
} SDL_RenderData;
typedef struct SDL_TextureData
{
uint32_t surface_type;
PdOffscreenContext_t* osurface;
PhImage_t* psurface;
PmMemoryContext_t* pcontext;
} SDL_TextureData;
extern void photon_addrenderdriver(_THIS);
/* Helper function, which redraws the backbuffer */
int _photon_update_rectangles(SDL_Renderer* renderer, PhRect_t* rect);
#endif /* __SDL_PHOTON_RENDER_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Graphics Framework SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_GF_INPUT_H__
#define __SDL_GF_INPUT_H__
#include "SDL_config.h"
#include "SDL_video.h"
#include "../SDL_sysvideo.h"
#include <errno.h>
#include <gf/gf.h>
#include <sys/hiddi.h>
#include <sys/hidut.h>
#include "SDL_qnxgf.h"
typedef struct SDL_MouseData
{
SDL_DisplayData *didata;
} SDL_MouseData;
int32_t gf_addinputdevices(_THIS);
int32_t gf_delinputdevices(_THIS);
#define SDL_GF_MOUSE_COLOR_BLACK 0xFF000000
#define SDL_GF_MOUSE_COLOR_WHITE 0xFFFFFFFF
#define SDL_GF_MOUSE_COLOR_TRANS 0x00000000
/*****************************************************************************/
/* This is HIDDI closed interface declarations */
/*****************************************************************************/
#define HID_TYPE_MAIN 0x0
#define HID_TYPE_GLOBAL 0x1
#define HID_TYPE_LOCAL 0x2
#define HID_TYPE_RESERVED 0x3
#define HID_GLOBAL_USAGE_PAGE 0x0
#define HID_LOCAL_USAGE 0x0
typedef struct _hid_byte
{
uint8_t HIDB_Length;
uint8_t HIDB_Type;
uint8_t HIDB_Tag;
uint8_t reserved[1];
} hid_byte_t;
typedef struct _hidd_global_item
{
uint16_t usage_page;
uint16_t logical_min;
uint16_t logical_max;
uint16_t physical_min;
uint16_t physical_max;
uint16_t unit_expo;
uint16_t unit;
uint16_t report_size;
uint16_t report_id;
uint16_t report_count;
} hidd_global_item_t;
typedef struct _hidd_local_item
{
uint16_t type;
uint8_t reserved[2];
uint32_t value;
struct _hidd_local_item *next_local;
struct _hidd_local_item *alt_local;
} hidd_local_item_t;
typedef struct _hidd_local_table
{
hidd_local_item_t *usage_info;
hidd_local_item_t *designator_info;
hidd_local_item_t *string_info;
uint8_t delimiter;
uint8_t reserved[3];
} hidd_local_table_t;
typedef struct _hidd_field
{
struct hidd_report_instance *report;
struct hidd_collection *collection;
uint16_t report_offset;
uint16_t flags;
hidd_global_item_t gitem;
hidd_local_table_t *ltable;
struct _hidd_field *next_field;
void *user;
} hidd_field_t;
typedef struct hidd_report_instance
{
uint8_t report_id;
uint8_t reserved[1];
uint16_t report_type;
hidd_field_t *field;
uint16_t num_field;
uint16_t byte_len;
uint16_t bit_len;
uint8_t reserved2[2];
struct hidd_collection *collection;
struct hidd_report_instance *next_col_report;
struct hidd_report_instance *next_report;
} hidd_report_instance_t;
typedef struct hidd_report
{
TAILQ_ENTRY(hidd_report) link;
hidd_report_instance_t *rinst;
hidd_device_instance_t *dev_inst;
uint32_t flags;
struct hidd_connection *connection;
void *user;
} hidd_report_t;
typedef struct hidview_device
{
struct hidd_report_instance *instance;
struct hidd_report *report;
} hidview_device_t;
/*****************************************************************************/
/* Closed HIDDI interface declarations end */
/*****************************************************************************/
/* Maximum devices and subdevices amount per host */
#define SDL_HIDDI_MAX_DEVICES 64
/* Detected device/subdevice type for SDL */
#define SDL_GF_HIDDI_NONE 0x00000000
#define SDL_GF_HIDDI_MOUSE 0x00000001
#define SDL_GF_HIDDI_KEYBOARD 0x00000002
#define SDL_GF_HIDDI_JOYSTICK 0x00000003
extern void hiddi_enable_mouse();
extern void hiddi_disable_mouse();
#endif /* __SDL_GF_INPUT_H__ */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Graphics Framework SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#include <GLES/gl.h>
#include <GLES/glext.h>
/* This is OpenGL ES 1.0 helper functions from OpenGL ES 1.1 specification, */
/* which could be implemented independently from hardware, just wrappers */
GLAPI void APIENTRY
glTexParameteri(GLenum target, GLenum pname, GLint param)
{
glTexParameterx(target, pname, (GLfixed) param);
return;
}
GLAPI void APIENTRY
glTexParameteriv(GLenum target, GLenum pname, const GLint * params)
{
/* Retrieve one parameter only */
glTexParameterx(target, pname, (GLfixed) * params);
return;
}
GLAPI void APIENTRY
glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
{
glColor4f(((GLfloat) red) / 255.f, ((GLfloat) green) / 255.f,
((GLfloat) blue) / 255.f, ((GLfloat) alpha) / 255.f);
return;
}
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Graphics Framework SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_GF_OPENGLES_H__
#define __SDL_GF_OPENGLES_H__
#include <GLES/gl.h>
#include <GLES/glext.h>
GLAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param);
GLAPI void APIENTRY glTexParameteriv(GLenum target, GLenum pname,
const GLint * params);
GLAPI void APIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue,
GLubyte alpha);
#endif /* __SDL_GF_OPENGLES_H__ */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Graphics Framework SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#include "SDL_config.h"
#include "SDL_gf_pixelfmt.h"
gf_format_t
qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt)
{
switch (pixelfmt) {
case SDL_PIXELFORMAT_INDEX8:
{
return GF_FORMAT_PAL8;
}
break;
case SDL_PIXELFORMAT_ARGB1555:
{
return GF_FORMAT_PACK_ARGB1555;
}
break;
case SDL_PIXELFORMAT_RGB555:
{
/* RGB555 is the same as ARGB1555, but alpha is ignored */
return GF_FORMAT_PACK_ARGB1555;
}
break;
case SDL_PIXELFORMAT_RGB565:
{
return GF_FORMAT_PACK_RGB565;
}
break;
case SDL_PIXELFORMAT_BGR565:
{
return GF_FORMAT_PKBE_RGB565;
}
break;
case SDL_PIXELFORMAT_RGB24:
{
/* GF has wrong components order */
return GF_FORMAT_BGR888;
}
break;
case SDL_PIXELFORMAT_RGB888:
{
/* The same format as ARGB8888, but with alpha ignored */
/* and GF has wrong components order */
return GF_FORMAT_BGRA8888;
}
break;
case SDL_PIXELFORMAT_ARGB8888:
{
/* GF has wrong components order */
return GF_FORMAT_BGRA8888;
}
break;
case SDL_PIXELFORMAT_BGRA8888:
{
/* GF has wrong components order */
return GF_FORMAT_ARGB8888;
}
break;
case SDL_PIXELFORMAT_YV12:
{
return GF_FORMAT_PLANAR_YUV_YV12;
}
break;
case SDL_PIXELFORMAT_YUY2:
{
return GF_FORMAT_PACK_YUV_YUY2;
}
break;
case SDL_PIXELFORMAT_UYVY:
{
return GF_FORMAT_PACK_YUV_UYVY;
}
break;
case SDL_PIXELFORMAT_YVYU:
{
return GF_FORMAT_PACK_YUV_YVYU;
}
break;
}
return GF_FORMAT_INVALID;
}
uint32_t
qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt)
{
switch (pixelfmt) {
case GF_FORMAT_PAL8:
{
return SDL_PIXELFORMAT_INDEX8;
}
break;
case GF_FORMAT_PKLE_ARGB1555:
{
return SDL_PIXELFORMAT_ARGB1555;
}
break;
case GF_FORMAT_PACK_ARGB1555:
{
return SDL_PIXELFORMAT_ARGB1555;
}
break;
case GF_FORMAT_PKBE_RGB565:
{
return SDL_PIXELFORMAT_BGR565;
}
break;
case GF_FORMAT_PKLE_RGB565:
{
return SDL_PIXELFORMAT_RGB565;
}
break;
case GF_FORMAT_PACK_RGB565:
{
return SDL_PIXELFORMAT_RGB565;
}
break;
case GF_FORMAT_BGR888:
{
/* GF has wrong components order */
return SDL_PIXELFORMAT_RGB24;
}
break;
case GF_FORMAT_BGRA8888:
{
/* GF has wrong components order */
return SDL_PIXELFORMAT_ARGB8888;
}
break;
case GF_FORMAT_ARGB8888:
{
/* GF has wrong components order */
return SDL_PIXELFORMAT_BGRA8888;
}
break;
case GF_FORMAT_PLANAR_YUV_YV12:
{
return SDL_PIXELFORMAT_YV12;
}
break;
case GF_FORMAT_PACK_YUV_YUY2:
{
return SDL_PIXELFORMAT_YUY2;
}
break;
case GF_FORMAT_PACK_YUV_UYVY:
{
return SDL_PIXELFORMAT_UYVY;
}
break;
case GF_FORMAT_PACK_YUV_YVYU:
{
return SDL_PIXELFORMAT_YVYU;
}
break;
}
return SDL_PIXELFORMAT_UNKNOWN;
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Graphics Framework SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_GF_PIXELFMT_H__
#define __SDL_GF_PIXELFMT_H__
#include "../SDL_sysvideo.h"
#include <gf/gf.h>
gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt);
uint32_t qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt);
#endif /* __SDL_GF_PIXELFMT_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
QNX Graphics Framework SDL driver
Copyright (C) 2009 Mike Gorchak
(mike@malva.ua, lestat@i.com.ua)
*/
#ifndef __SDL_GF_RENDER_H__
#define __SDL_GF_RENDER_H__
#include "../SDL_sysvideo.h"
#include <gf/gf.h>
#define SDL_GF_MAX_SURFACES 3
typedef struct SDL_RenderData
{
SDL_Window *window; /* SDL window type */
SDL_bool enable_vsync; /* VSYNC flip synchronization enable */
gf_surface_t surface[SDL_GF_MAX_SURFACES]; /* Surface handles */
gf_surface_info_t surface_info[SDL_GF_MAX_SURFACES]; /* Surface info */
uint32_t surface_visible_idx; /* Index of visible surface */
uint32_t surface_render_idx; /* Index of render surface */
uint32_t surfaces_count; /* Amount of allocated surfaces */
} SDL_RenderData;
typedef struct SDL_TextureData
{
gf_surface_t surface;
gf_surface_info_t surface_info;
} SDL_TextureData;
extern void gf_addrenderdriver(_THIS);
#endif /* __SDL_GF_RENDER_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -116,10 +116,6 @@ main(int argc, char *argv[]) ...@@ -116,10 +116,6 @@ main(int argc, char *argv[])
/* you may want to change these according to the platform */ /* you may want to change these according to the platform */
video_w = 320; video_w = 320;
video_h = 480; video_h = 480;
#ifdef __QNXNTO__
video_w = 480;
video_h = 640;
#endif /* __QNXNTO__ */
if (argv[1]) { if (argv[1]) {
gl_library = argv[1]; gl_library = argv[1];
...@@ -151,12 +147,7 @@ main(int argc, char *argv[]) ...@@ -151,12 +147,7 @@ main(int argc, char *argv[])
pixels[3 * i + 2] = rand() % 250 - 125; pixels[3 * i + 2] = rand() % 250 - 125;
} }
#ifdef __QNXNTO__
f.glViewport(0, 0, video_h, video_w);
#else
f.glViewport(0, 0, video_w, video_h); f.glViewport(0, 0, video_w, video_h);
#endif /* __QNXNTO__ */
f.glMatrixMode(GL_PROJECTION); f.glMatrixMode(GL_PROJECTION);
f.glLoadIdentity(); f.glLoadIdentity();
f.glOrthof(-100, 100, -100, 100, -500, 500); f.glOrthof(-100, 100, -100, 100, -500, 500);
......
This diff is collapsed.
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