Nobody is currently maintaining the QNX code, so removing it for now.
This commit is contained in:
parent
09a8558897
commit
a47948aab0
34 changed files with 46 additions and 10460 deletions
2
README
2
README
|
@ -13,7 +13,7 @@ level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
|
|||
and 2D framebuffer across multiple platforms.
|
||||
|
||||
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.
|
||||
|
||||
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>
|
|||
Platforms that need maintainers
|
||||
===============================
|
||||
Nintendo DS
|
||||
QNX
|
||||
Haiku
|
||||
|
|
108
README.QNX
108
README.QNX
|
@ -1,108 +0,0 @@
|
|||
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 --
|
||||
----------------------------
|
175
configure.in
175
configure.in
|
@ -1326,70 +1326,6 @@ AC_HELP_STRING([--enable-video-x11-xdamage-xfixes], [enable X11 Xdamage and Xfix
|
|||
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
|
||||
CheckBWINDOW()
|
||||
{
|
||||
|
@ -1594,65 +1530,6 @@ CheckOpenGLX11()
|
|||
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
|
||||
CheckWINDOWSGL()
|
||||
{
|
||||
|
@ -1796,10 +1673,6 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]])
|
|||
pthread_cflags="-D_REENTRANT"
|
||||
pthread_lib="-L/usr/lib -lpthread"
|
||||
;;
|
||||
*-*-qnx*)
|
||||
pthread_cflags=""
|
||||
pthread_lib=""
|
||||
;;
|
||||
*-*-osf*)
|
||||
pthread_cflags="-D_REENTRANT"
|
||||
if test x$ac_cv_prog_gcc = xyes; then
|
||||
|
@ -2287,54 +2160,6 @@ case "$host" in
|
|||
have_timers=yes
|
||||
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)
|
||||
ARCH=win32
|
||||
CheckDummyVideo
|
||||
|
|
|
@ -37,10 +37,6 @@
|
|||
* level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
|
||||
* 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
|
||||
* several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
|
||||
* Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
|
||||
|
|
|
@ -261,8 +261,6 @@
|
|||
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_DUMMY
|
||||
#undef SDL_VIDEO_DRIVER_NDS
|
||||
#undef SDL_VIDEO_DRIVER_PHOTON
|
||||
#undef SDL_VIDEO_DRIVER_QNXGF
|
||||
#undef SDL_VIDEO_DRIVER_WINDOWS
|
||||
#undef SDL_VIDEO_DRIVER_X11
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
|
||||
|
|
|
@ -211,9 +211,6 @@ GL_SetError(const char *prefix, GLenum result)
|
|||
static int
|
||||
GL_LoadFunctions(GL_RenderData * data)
|
||||
{
|
||||
#if defined(__QNXNTO__) && (_NTO_VERSION < 630)
|
||||
#define __SDL_NOGETPROCADDR__
|
||||
#endif
|
||||
#ifdef __SDL_NOGETPROCADDR__
|
||||
#define SDL_PROC(ret,func,params) data->func=func;
|
||||
#else
|
||||
|
|
|
@ -30,14 +30,7 @@
|
|||
#include "SDL_rect_c.h"
|
||||
#include "SDL_yuv_sw_c.h"
|
||||
|
||||
#if defined(__QNXNTO__)
|
||||
/* 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)
|
||||
#if defined(SDL_VIDEO_DRIVER_PANDORA)
|
||||
|
||||
/* Empty function stub to get OpenGL ES 1.x support without */
|
||||
/* OpenGL ES extension GL_OES_draw_texture supported */
|
||||
|
@ -47,7 +40,7 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
|
|||
return;
|
||||
}
|
||||
|
||||
#endif /* QNXGF || PHOTON || PANDORA */
|
||||
#endif /* PANDORA */
|
||||
|
||||
/* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
|
||||
|
||||
|
@ -229,16 +222,6 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||
|
||||
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) {
|
||||
GLES_DestroyRenderer(renderer);
|
||||
return NULL;
|
||||
|
|
|
@ -397,30 +397,21 @@ extern VideoBootStrap WINDOWS_bootstrap;
|
|||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
extern VideoBootStrap BWINDOW_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_PHOTON
|
||||
extern VideoBootStrap photon_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;
|
||||
#if SDL_VIDEO_DRIVER_PANDORA
|
||||
extern VideoBootStrap PND_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_NDS
|
||||
extern VideoBootStrap NDS_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_PANDORA
|
||||
extern VideoBootStrap PND_bootstrap;
|
||||
#if SDL_VIDEO_DRIVER_UIKIT
|
||||
extern VideoBootStrap UIKIT_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
extern VideoBootStrap Android_bootstrap;
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_DUMMY
|
||||
extern VideoBootStrap DUMMY_bootstrap;
|
||||
#endif
|
||||
|
||||
#define SDL_CurrentDisplay (&_this->displays[_this->current_display])
|
||||
|
||||
|
|
|
@ -70,14 +70,8 @@ static VideoBootStrap *bootstrap[] = {
|
|||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
&BWINDOW_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_PHOTON
|
||||
&photon_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_QNXGF
|
||||
&qnxgf_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_EPOC
|
||||
&EPOC_bootstrap,
|
||||
#if SDL_VIDEO_DRIVER_PANDORA
|
||||
&PND_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_NDS
|
||||
&NDS_bootstrap,
|
||||
|
@ -85,14 +79,11 @@ static VideoBootStrap *bootstrap[] = {
|
|||
#if SDL_VIDEO_DRIVER_UIKIT
|
||||
&UIKIT_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_DUMMY
|
||||
&DUMMY_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_PANDORA
|
||||
&PND_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
&Android_bootstrap,
|
||||
#endif
|
||||
#if SDL_VIDEO_DRIVER_DUMMY
|
||||
&DUMMY_bootstrap,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,178 +0,0 @@
|
|||
/*
|
||||
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: */
|
|
@ -1,726 +0,0 @@
|
|||
/*
|
||||
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_input.h"
|
||||
|
||||
#include "SDL_config.h"
|
||||
#include "SDL_events.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
|
||||
#include "SDL_photon_keycodes.h"
|
||||
|
||||
/* Mouse related functions */
|
||||
SDL_Cursor *photon_createcursor(SDL_Surface * surface, int hot_x, int hot_y);
|
||||
int photon_showcursor(SDL_Cursor * cursor);
|
||||
void photon_movecursor(SDL_Cursor * cursor);
|
||||
void photon_freecursor(SDL_Cursor * cursor);
|
||||
void photon_warpmouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y);
|
||||
void photon_freemouse(SDL_Mouse * mouse);
|
||||
|
||||
int32_t
|
||||
photon_addinputdevices(_THIS)
|
||||
{
|
||||
SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
|
||||
SDL_DisplayData *didata = NULL;
|
||||
struct SDL_Mouse photon_mouse;
|
||||
SDL_MouseData *mdata = NULL;
|
||||
SDL_Keyboard photon_keyboard;
|
||||
SDLKey keymap[SDL_NUM_SCANCODES];
|
||||
uint32_t it;
|
||||
|
||||
for (it = 0; it < _this->num_displays; it++) {
|
||||
SDL_VideoDisplay *display = &_this->displays[it];
|
||||
|
||||
/* Clear SDL mouse structure */
|
||||
SDL_memset(&photon_mouse, 0x00, sizeof(struct SDL_Mouse));
|
||||
|
||||
/* Allocate SDL_MouseData structure */
|
||||
mdata = (SDL_MouseData *) SDL_calloc(1, sizeof(SDL_MouseData));
|
||||
if (mdata == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Mark this mouse with ID 0 */
|
||||
photon_mouse.id = it;
|
||||
photon_mouse.driverdata = (void *) mdata;
|
||||
photon_mouse.CreateCursor = photon_createcursor;
|
||||
photon_mouse.ShowCursor = photon_showcursor;
|
||||
photon_mouse.MoveCursor = photon_movecursor;
|
||||
photon_mouse.FreeCursor = photon_freecursor;
|
||||
photon_mouse.WarpMouse = photon_warpmouse;
|
||||
photon_mouse.FreeMouse = photon_freemouse;
|
||||
|
||||
/* Get display data */
|
||||
didata = (SDL_DisplayData *) display->driverdata;
|
||||
|
||||
/* Store SDL_DisplayData pointer in the mouse driver internals */
|
||||
mdata->didata = didata;
|
||||
|
||||
/* Register mouse cursor in SDL */
|
||||
SDL_AddMouse(&photon_mouse, "Photon mouse cursor", 0, 0, 1);
|
||||
}
|
||||
|
||||
/* Photon maps all keyboards to one */
|
||||
SDL_zero(photon_keyboard);
|
||||
SDL_AddKeyboard(&photon_keyboard, -1);
|
||||
|
||||
/* Add default scancode to key mapping */
|
||||
SDL_GetDefaultKeymap(keymap);
|
||||
SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t
|
||||
photon_delinputdevices(_THIS)
|
||||
{
|
||||
/* Destroy all of the mice */
|
||||
SDL_MouseQuit();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Photon mouse related functions */
|
||||
/*****************************************************************************/
|
||||
SDL_Cursor *
|
||||
photon_createcursor(SDL_Surface * surface, int hot_x, int hot_y)
|
||||
{
|
||||
PhCursorDef_t *internal_cursor;
|
||||
SDL_Cursor *sdl_cursor;
|
||||
uint8_t *image0 = NULL;
|
||||
uint8_t *image1 = NULL;
|
||||
uint32_t it;
|
||||
uint32_t jt;
|
||||
uint32_t shape_color;
|
||||
|
||||
/* SDL converts monochrome cursor shape to 32bpp cursor shape */
|
||||
/* and we must convert it back to monochrome, this routine handles */
|
||||
/* 24/32bpp surfaces only */
|
||||
if ((surface->format->BitsPerPixel != 32)
|
||||
&& (surface->format->BitsPerPixel != 24)) {
|
||||
SDL_SetError("Photon: Cursor shape is not 24/32bpp.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Checking data parameters */
|
||||
if ((surface->w == 0) || (surface->h == 0)) {
|
||||
SDL_SetError("Photon: Cursor shape dimensions are zero");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allocate memory for the internal cursor format */
|
||||
internal_cursor = (PhCursorDef_t *) SDL_calloc(1, sizeof(PhCursorDef_t) +
|
||||
((((surface->w +
|
||||
7) >> 3) *
|
||||
surface->h) * 2) - 1);
|
||||
if (internal_cursor == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allocate memory for the SDL cursor */
|
||||
sdl_cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(SDL_Cursor));
|
||||
if (sdl_cursor == NULL) {
|
||||
SDL_free(internal_cursor);
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Set driverdata as photon cursor format */
|
||||
image0 = (uint8_t *) internal_cursor;
|
||||
image0 += sizeof(PhCursorDef_t) - 1;
|
||||
image1 = image0;
|
||||
image1 += ((surface->w + 7) >> 3) * surface->h;
|
||||
sdl_cursor->driverdata = (void *) internal_cursor;
|
||||
internal_cursor->hdr.len =
|
||||
(sizeof(PhCursorDef_t) - sizeof(PhRegionDataHdr_t)) +
|
||||
((((surface->w + 7) >> 3) * surface->h) * 2) - 1;
|
||||
internal_cursor->hdr.type = Ph_RDATA_CURSOR;
|
||||
internal_cursor->size1.x = surface->w;
|
||||
internal_cursor->size1.y = surface->h;
|
||||
internal_cursor->size2.x = surface->w;
|
||||
internal_cursor->size2.y = surface->h;
|
||||
internal_cursor->offset1.x = -hot_x;
|
||||
internal_cursor->offset1.y = -hot_y;
|
||||
internal_cursor->offset2.x = -hot_x;
|
||||
internal_cursor->offset2.y = -hot_y;
|
||||
internal_cursor->bytesperline1 = ((surface->w + 7) >> 3);
|
||||
internal_cursor->bytesperline2 = ((surface->w + 7) >> 3);
|
||||
internal_cursor->color1 = (SDL_PHOTON_MOUSE_COLOR_BLACK) & 0x00FFFFFF;
|
||||
internal_cursor->color2 = (SDL_PHOTON_MOUSE_COLOR_WHITE) & 0x00FFFFFF;
|
||||
|
||||
/* Convert cursor from 32 bpp */
|
||||
for (jt = 0; jt < surface->h; jt++) {
|
||||
for (it = 0; it < surface->w; it++) {
|
||||
shape_color =
|
||||
*((uint32_t *) ((uint8_t *) surface->pixels +
|
||||
jt * surface->pitch +
|
||||
it * surface->format->BytesPerPixel));
|
||||
switch (shape_color) {
|
||||
case SDL_PHOTON_MOUSE_COLOR_BLACK:
|
||||
{
|
||||
*(image0 + jt * (internal_cursor->bytesperline1) +
|
||||
(it >> 3)) |= 0x80 >> (it % 8);
|
||||
*(image1 + jt * (internal_cursor->bytesperline2) +
|
||||
(it >> 3)) &= ~(0x80 >> (it % 8));
|
||||
}
|
||||
break;
|
||||
case SDL_PHOTON_MOUSE_COLOR_WHITE:
|
||||
{
|
||||
*(image0 + jt * (internal_cursor->bytesperline1) +
|
||||
(it >> 3)) &= ~(0x80 >> (it % 8));
|
||||
*(image1 + jt * (internal_cursor->bytesperline2) +
|
||||
(it >> 3)) |= 0x80 >> (it % 8);
|
||||
}
|
||||
break;
|
||||
case SDL_PHOTON_MOUSE_COLOR_TRANS:
|
||||
{
|
||||
*(image0 + jt * (internal_cursor->bytesperline1) +
|
||||
(it >> 3)) &= ~(0x80 >> (it % 8));
|
||||
*(image1 + jt * (internal_cursor->bytesperline2) +
|
||||
(it >> 3)) &= ~(0x80 >> (it % 8));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
/* The same as transparent color, must not happen */
|
||||
*(image0 + jt * (internal_cursor->bytesperline1) +
|
||||
(it >> 3)) &= ~(0x80 >> (it % 8));
|
||||
*(image1 + jt * (internal_cursor->bytesperline2) +
|
||||
(it >> 3)) &= ~(0x80 >> (it % 8));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sdl_cursor;
|
||||
}
|
||||
|
||||
int
|
||||
photon_showcursor(SDL_Cursor * cursor)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
SDL_DisplayData *didata;
|
||||
SDL_Window *window;
|
||||
SDL_WindowData *wdata;
|
||||
PhCursorDef_t *internal_cursor;
|
||||
int32_t status;
|
||||
|
||||
/* Get current window id */
|
||||
window = SDL_GetFocusWindow();
|
||||
if (!window) {
|
||||
SDL_MouseData *mdata = NULL;
|
||||
|
||||
/* If there is no current window, then someone calls this function */
|
||||
/* to set global mouse settings during SDL initialization */
|
||||
if (cursor != NULL) {
|
||||
/* Store cursor for future usage */
|
||||
mdata = (SDL_MouseData *) cursor->mouse->driverdata;
|
||||
didata = (SDL_DisplayData *) mdata->didata;
|
||||
internal_cursor = (PhCursorDef_t *) cursor->driverdata;
|
||||
|
||||
if (didata->cursor_size >=
|
||||
(internal_cursor->hdr.len + sizeof(PhRegionDataHdr_t))) {
|
||||
SDL_memcpy(didata->cursor, internal_cursor,
|
||||
internal_cursor->hdr.len +
|
||||
sizeof(PhRegionDataHdr_t));
|
||||
} else {
|
||||
/* Partitial cursor image */
|
||||
SDL_memcpy(didata->cursor, internal_cursor,
|
||||
didata->cursor_size);
|
||||
}
|
||||
|
||||
didata->cursor_visible = SDL_TRUE;
|
||||
return 0;
|
||||
} else {
|
||||
/* We can't get SDL_DisplayData at this point, return fake success */
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
/* Sanity checks */
|
||||
display = window->display;
|
||||
if (display != NULL) {
|
||||
didata = (SDL_DisplayData *) display->driverdata;
|
||||
if (didata != NULL) {
|
||||
wdata = (SDL_WindowData *) window->driverdata;
|
||||
if (wdata == NULL) {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* return if window widget has been destroyed already */
|
||||
if (wdata->window == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if we need to set new shape or disable cursor shape */
|
||||
if (cursor != NULL) {
|
||||
/* Retrieve photon cursor shape */
|
||||
internal_cursor = (PhCursorDef_t *) cursor->driverdata;
|
||||
if (internal_cursor == NULL) {
|
||||
SDL_SetError("Photon: Internal cursor data is absent");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Setup cursor type */
|
||||
status =
|
||||
PtSetResource(wdata->window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP,
|
||||
0);
|
||||
if (status != 0) {
|
||||
SDL_SetError("Photon: Failed to set cursor type to bitmap");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Setup cursor color to default */
|
||||
status =
|
||||
PtSetResource(wdata->window, Pt_ARG_CURSOR_COLOR,
|
||||
Ph_CURSOR_DEFAULT_COLOR, 0);
|
||||
if (status != 0) {
|
||||
SDL_SetError("Photon: Failed to set cursor color");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Setup cursor shape */
|
||||
status =
|
||||
PtSetResource(wdata->window, Pt_ARG_BITMAP_CURSOR,
|
||||
internal_cursor,
|
||||
internal_cursor->hdr.len +
|
||||
sizeof(PhRegionDataHdr_t));
|
||||
if (status != 0) {
|
||||
SDL_SetError("Photon: Failed to set cursor color");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Store current cursor for future usage */
|
||||
if (didata->cursor_size >=
|
||||
(internal_cursor->hdr.len + sizeof(PhRegionDataHdr_t))) {
|
||||
SDL_memcpy(didata->cursor, internal_cursor,
|
||||
internal_cursor->hdr.len + sizeof(PhRegionDataHdr_t));
|
||||
} else {
|
||||
/* Partitial cursor image */
|
||||
SDL_memcpy(didata->cursor, internal_cursor, didata->cursor_size);
|
||||
}
|
||||
|
||||
/* Set cursor visible */
|
||||
didata->cursor_visible = SDL_TRUE;
|
||||
} else {
|
||||
/* SDL requests to disable cursor */
|
||||
status =
|
||||
PtSetResource(wdata->window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE,
|
||||
0);
|
||||
if (status != 0) {
|
||||
SDL_SetError("Photon: Can't disable cursor");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set cursor invisible */
|
||||
didata->cursor_visible = SDL_FALSE;
|
||||
}
|
||||
|
||||
/* Flush all pending widget data */
|
||||
PtFlush();
|
||||
|
||||
/* New cursor shape is set */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
photon_movecursor(SDL_Cursor * cursor)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
SDL_DisplayData *didata;
|
||||
SDL_Window *window;
|
||||
SDL_WindowData *wdata;
|
||||
SDL_WindowID window_id;
|
||||
int32_t status;
|
||||
|
||||
/* Get current window id */
|
||||
window_id = SDL_GetFocusWindow();
|
||||
if (window_id <= 0) {
|
||||
didata = (SDL_DisplayData *) cursor->mouse->driverdata;
|
||||
} else {
|
||||
/* Sanity checks */
|
||||
window = SDL_GetWindowFromID(window_id);
|
||||
if (window != NULL) {
|
||||
display = window->display;
|
||||
if (display != NULL) {
|
||||
didata = (SDL_DisplayData *) display->driverdata;
|
||||
if (didata != NULL) {
|
||||
wdata = (SDL_WindowData *) window->driverdata;
|
||||
if (wdata == NULL) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* No need to move mouse cursor manually in the photon */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
photon_freecursor(SDL_Cursor * cursor)
|
||||
{
|
||||
PhCursorDef_t *internal_cursor = NULL;
|
||||
|
||||
if (cursor != NULL) {
|
||||
internal_cursor = (PhCursorDef_t *) cursor->driverdata;
|
||||
if (internal_cursor != NULL) {
|
||||
SDL_free(internal_cursor);
|
||||
cursor->driverdata = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
photon_warpmouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
SDL_DisplayData *didata;
|
||||
SDL_WindowData *wdata;
|
||||
int16_t wx;
|
||||
int16_t wy;
|
||||
|
||||
/* Sanity checks */
|
||||
if (window != NULL) {
|
||||
display = window->display;
|
||||
if (display != NULL) {
|
||||
didata = (SDL_DisplayData *) display->driverdata;
|
||||
if (didata != NULL) {
|
||||
wdata = (SDL_WindowData *) window->driverdata;
|
||||
if (wdata == NULL) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
PtGetAbsPosition(wdata->window, &wx, &wy);
|
||||
PhMoveCursorAbs(PhInputGroup(NULL), wx + x, wy + y);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
photon_freemouse(SDL_Mouse * mouse)
|
||||
{
|
||||
if (mouse->driverdata == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Mouse framework doesn't deletes automatically our driverdata */
|
||||
SDL_free(mouse->driverdata);
|
||||
mouse->driverdata = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_ScanCode
|
||||
photon_to_sdl_keymap(uint32_t key)
|
||||
{
|
||||
SDL_ScanCode scancode = SDL_SCANCODE_UNKNOWN;
|
||||
|
||||
switch (key & 0x0000007F) {
|
||||
case PHOTON_SCANCODE_ESCAPE:
|
||||
scancode = SDL_SCANCODE_ESCAPE;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F1:
|
||||
scancode = SDL_SCANCODE_F1;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F2:
|
||||
scancode = SDL_SCANCODE_F2;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F3:
|
||||
scancode = SDL_SCANCODE_F3;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F4:
|
||||
scancode = SDL_SCANCODE_F4;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F5:
|
||||
scancode = SDL_SCANCODE_F5;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F6:
|
||||
scancode = SDL_SCANCODE_F6;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F7:
|
||||
scancode = SDL_SCANCODE_F7;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F8:
|
||||
scancode = SDL_SCANCODE_F8;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F9:
|
||||
scancode = SDL_SCANCODE_F9;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F10:
|
||||
scancode = SDL_SCANCODE_F10;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F11:
|
||||
scancode = SDL_SCANCODE_F11;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F12:
|
||||
scancode = SDL_SCANCODE_F12;
|
||||
break;
|
||||
case PHOTON_SCANCODE_BACKQOUTE:
|
||||
scancode = SDL_SCANCODE_GRAVE;
|
||||
break;
|
||||
case PHOTON_SCANCODE_1:
|
||||
scancode = SDL_SCANCODE_1;
|
||||
break;
|
||||
case PHOTON_SCANCODE_2:
|
||||
scancode = SDL_SCANCODE_2;
|
||||
break;
|
||||
case PHOTON_SCANCODE_3:
|
||||
scancode = SDL_SCANCODE_3;
|
||||
break;
|
||||
case PHOTON_SCANCODE_4:
|
||||
scancode = SDL_SCANCODE_4;
|
||||
break;
|
||||
case PHOTON_SCANCODE_5:
|
||||
scancode = SDL_SCANCODE_5;
|
||||
break;
|
||||
case PHOTON_SCANCODE_6:
|
||||
scancode = SDL_SCANCODE_6;
|
||||
break;
|
||||
case PHOTON_SCANCODE_7:
|
||||
scancode = SDL_SCANCODE_7;
|
||||
break;
|
||||
case PHOTON_SCANCODE_8:
|
||||
scancode = SDL_SCANCODE_8;
|
||||
break;
|
||||
case PHOTON_SCANCODE_9:
|
||||
scancode = SDL_SCANCODE_9;
|
||||
break;
|
||||
case PHOTON_SCANCODE_0:
|
||||
scancode = SDL_SCANCODE_0;
|
||||
break;
|
||||
case PHOTON_SCANCODE_MINUS:
|
||||
scancode = SDL_SCANCODE_MINUS;
|
||||
break;
|
||||
case PHOTON_SCANCODE_EQUAL:
|
||||
scancode = SDL_SCANCODE_EQUALS;
|
||||
break;
|
||||
case PHOTON_SCANCODE_BACKSPACE:
|
||||
scancode = SDL_SCANCODE_BACKSPACE;
|
||||
break;
|
||||
case PHOTON_SCANCODE_TAB:
|
||||
scancode = SDL_SCANCODE_TAB;
|
||||
break;
|
||||
case PHOTON_SCANCODE_Q:
|
||||
scancode = SDL_SCANCODE_Q;
|
||||
break;
|
||||
case PHOTON_SCANCODE_W:
|
||||
scancode = SDL_SCANCODE_W;
|
||||
break;
|
||||
case PHOTON_SCANCODE_E:
|
||||
scancode = SDL_SCANCODE_E;
|
||||
break;
|
||||
case PHOTON_SCANCODE_R:
|
||||
scancode = SDL_SCANCODE_R;
|
||||
break;
|
||||
case PHOTON_SCANCODE_T:
|
||||
scancode = SDL_SCANCODE_T;
|
||||
break;
|
||||
case PHOTON_SCANCODE_Y:
|
||||
scancode = SDL_SCANCODE_Y;
|
||||
break;
|
||||
case PHOTON_SCANCODE_U:
|
||||
scancode = SDL_SCANCODE_U;
|
||||
break;
|
||||
case PHOTON_SCANCODE_I:
|
||||
scancode = SDL_SCANCODE_I;
|
||||
break;
|
||||
case PHOTON_SCANCODE_O:
|
||||
scancode = SDL_SCANCODE_O;
|
||||
break;
|
||||
case PHOTON_SCANCODE_P:
|
||||
scancode = SDL_SCANCODE_P;
|
||||
break;
|
||||
case PHOTON_SCANCODE_LEFT_SQ_BR:
|
||||
scancode = SDL_SCANCODE_LEFTBRACKET;
|
||||
break;
|
||||
case PHOTON_SCANCODE_RIGHT_SQ_BR:
|
||||
scancode = SDL_SCANCODE_RIGHTBRACKET;
|
||||
break;
|
||||
case PHOTON_SCANCODE_ENTER:
|
||||
scancode = SDL_SCANCODE_RETURN;
|
||||
break;
|
||||
case PHOTON_SCANCODE_CAPSLOCK:
|
||||
scancode = SDL_SCANCODE_CAPSLOCK;
|
||||
break;
|
||||
case PHOTON_SCANCODE_A:
|
||||
scancode = SDL_SCANCODE_A;
|
||||
break;
|
||||
case PHOTON_SCANCODE_S:
|
||||
scancode = SDL_SCANCODE_S;
|
||||
break;
|
||||
case PHOTON_SCANCODE_D:
|
||||
scancode = SDL_SCANCODE_D;
|
||||
break;
|
||||
case PHOTON_SCANCODE_F:
|
||||
scancode = SDL_SCANCODE_F;
|
||||
break;
|
||||
case PHOTON_SCANCODE_G:
|
||||
scancode = SDL_SCANCODE_G;
|
||||
break;
|
||||
case PHOTON_SCANCODE_H:
|
||||
scancode = SDL_SCANCODE_H;
|
||||
break;
|
||||
case PHOTON_SCANCODE_J:
|
||||
scancode = SDL_SCANCODE_J;
|
||||
break;
|
||||
case PHOTON_SCANCODE_K:
|
||||
scancode = SDL_SCANCODE_K;
|
||||
break;
|
||||
case PHOTON_SCANCODE_L:
|
||||
scancode = SDL_SCANCODE_L;
|
||||
break;
|
||||
case PHOTON_SCANCODE_SEMICOLON:
|
||||
scancode = SDL_SCANCODE_SEMICOLON;
|
||||
break;
|
||||
case PHOTON_SCANCODE_QUOTE:
|
||||
scancode = SDL_SCANCODE_APOSTROPHE;
|
||||
break;
|
||||
case PHOTON_SCANCODE_BACKSLASH:
|
||||
scancode = SDL_SCANCODE_BACKSLASH;
|
||||
break;
|
||||
case PHOTON_SCANCODE_LEFT_SHIFT:
|
||||
scancode = SDL_SCANCODE_LSHIFT;
|
||||
break;
|
||||
case PHOTON_SCANCODE_Z:
|
||||
scancode = SDL_SCANCODE_Z;
|
||||
break;
|
||||
case PHOTON_SCANCODE_X:
|
||||
scancode = SDL_SCANCODE_X;
|
||||
break;
|
||||
case PHOTON_SCANCODE_C:
|
||||
scancode = SDL_SCANCODE_C;
|
||||
break;
|
||||
case PHOTON_SCANCODE_V:
|
||||
scancode = SDL_SCANCODE_V;
|
||||
break;
|
||||
case PHOTON_SCANCODE_B:
|
||||
scancode = SDL_SCANCODE_B;
|
||||
break;
|
||||
case PHOTON_SCANCODE_N:
|
||||
scancode = SDL_SCANCODE_N;
|
||||
break;
|
||||
case PHOTON_SCANCODE_M:
|
||||
scancode = SDL_SCANCODE_M;
|
||||
break;
|
||||
case PHOTON_SCANCODE_COMMA:
|
||||
scancode = SDL_SCANCODE_COMMA;
|
||||
break;
|
||||
case PHOTON_SCANCODE_POINT:
|
||||
scancode = SDL_SCANCODE_PERIOD;
|
||||
break;
|
||||
case PHOTON_SCANCODE_SLASH:
|
||||
scancode = SDL_SCANCODE_SLASH;
|
||||
break;
|
||||
case PHOTON_SCANCODE_RIGHT_SHIFT:
|
||||
scancode = SDL_SCANCODE_RSHIFT;
|
||||
break;
|
||||
case PHOTON_SCANCODE_CTRL:
|
||||
scancode = SDL_SCANCODE_LCTRL;
|
||||
break;
|
||||
case PHOTON_SCANCODE_WFLAG:
|
||||
scancode = SDL_SCANCODE_LGUI;
|
||||
break;
|
||||
case PHOTON_SCANCODE_ALT:
|
||||
scancode = SDL_SCANCODE_LALT;
|
||||
break;
|
||||
case PHOTON_SCANCODE_SPACE:
|
||||
scancode = SDL_SCANCODE_SPACE;
|
||||
break;
|
||||
case PHOTON_SCANCODE_MENU:
|
||||
scancode = SDL_SCANCODE_MENU;
|
||||
break;
|
||||
case PHOTON_SCANCODE_PRNSCR:
|
||||
scancode = SDL_SCANCODE_PRINTSCREEN;
|
||||
break;
|
||||
case PHOTON_SCANCODE_SCROLLLOCK:
|
||||
scancode = SDL_SCANCODE_SCROLLLOCK;
|
||||
break;
|
||||
case PHOTON_SCANCODE_INSERT:
|
||||
scancode = SDL_SCANCODE_INSERT;
|
||||
break;
|
||||
case PHOTON_SCANCODE_HOME:
|
||||
scancode = SDL_SCANCODE_HOME;
|
||||
break;
|
||||
case PHOTON_SCANCODE_PAGEUP:
|
||||
scancode = SDL_SCANCODE_PAGEUP;
|
||||
break;
|
||||
case PHOTON_SCANCODE_DELETE:
|
||||
scancode = SDL_SCANCODE_DELETE;
|
||||
break;
|
||||
case PHOTON_SCANCODE_END:
|
||||
scancode = SDL_SCANCODE_END;
|
||||
break;
|
||||
case PHOTON_SCANCODE_PAGEDOWN:
|
||||
scancode = SDL_SCANCODE_PAGEDOWN;
|
||||
break;
|
||||
case PHOTON_SCANCODE_UP:
|
||||
scancode = SDL_SCANCODE_UP;
|
||||
break;
|
||||
case PHOTON_SCANCODE_DOWN:
|
||||
scancode = SDL_SCANCODE_DOWN;
|
||||
break;
|
||||
case PHOTON_SCANCODE_LEFT:
|
||||
scancode = SDL_SCANCODE_LEFT;
|
||||
break;
|
||||
case PHOTON_SCANCODE_RIGHT:
|
||||
scancode = SDL_SCANCODE_RIGHT;
|
||||
break;
|
||||
case PHOTON_SCANCODE_NUMLOCK:
|
||||
scancode = SDL_SCANCODE_NUMLOCKCLEAR;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return scancode;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
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__ */
|
|
@ -1,125 +0,0 @@
|
|||
/*
|
||||
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__ */
|
|
@ -1,218 +0,0 @@
|
|||
/*
|
||||
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: */
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
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: */
|
File diff suppressed because it is too large
Load diff
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
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: */
|
File diff suppressed because it is too large
Load diff
|
@ -1,165 +0,0 @@
|
|||
/*
|
||||
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__ */
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
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;
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
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__ */
|
|
@ -1,187 +0,0 @@
|
|||
/*
|
||||
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: */
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
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: */
|
|
@ -1,373 +0,0 @@
|
|||
/*
|
||||
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_pixels_c.h"
|
||||
#include "../SDL_yuv_sw_c.h"
|
||||
|
||||
#include "SDL_video.h"
|
||||
|
||||
#include "SDL_gf_render.h"
|
||||
#include "SDL_qnxgf.h"
|
||||
|
||||
static SDL_Renderer *gf_createrenderer(SDL_Window * window, Uint32 flags);
|
||||
static int gf_displaymodechanged(SDL_Renderer * renderer);
|
||||
static int gf_activaterenderer(SDL_Renderer * renderer);
|
||||
static int gf_createtexture(SDL_Renderer * renderer, SDL_Texture * texture);
|
||||
static int gf_querytexturepixels(SDL_Renderer * renderer,
|
||||
SDL_Texture * texture, void **pixels,
|
||||
int *pitch);
|
||||
static int gf_settexturepalette(SDL_Renderer * renderer,
|
||||
SDL_Texture * texture,
|
||||
const SDL_Color * colors, int firstcolor,
|
||||
int ncolors);
|
||||
static int gf_gettexturepalette(SDL_Renderer * renderer,
|
||||
SDL_Texture * texture, SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
static int gf_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect, const void *pixels,
|
||||
int pitch);
|
||||
static int gf_locktexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect, int markDirty, void **pixels,
|
||||
int *pitch);
|
||||
static void gf_unlocktexture(SDL_Renderer * renderer, SDL_Texture * texture);
|
||||
static void gf_dirtytexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
int numrects, const SDL_Rect * rects);
|
||||
static int gf_renderpoint(SDL_Renderer * renderer, int x, int y);
|
||||
static int gf_renderline(SDL_Renderer * renderer, int x1, int y1, int x2,
|
||||
int y2);
|
||||
static int gf_renderfill(SDL_Renderer * renderer, const SDL_Rect * rect);
|
||||
static int gf_rendercopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * srcrect, const SDL_Rect * dstrect);
|
||||
static void gf_renderpresent(SDL_Renderer * renderer);
|
||||
static void gf_destroytexture(SDL_Renderer * renderer, SDL_Texture * texture);
|
||||
static void gf_destroyrenderer(SDL_Renderer * renderer);
|
||||
|
||||
SDL_RenderDriver gf_renderdriver = {
|
||||
gf_createrenderer,
|
||||
{
|
||||
"qnxgf",
|
||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
|
||||
SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
|
||||
SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD |
|
||||
SDL_RENDERER_ACCELERATED),
|
||||
12,
|
||||
{
|
||||
SDL_PIXELFORMAT_RGB555,
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
SDL_PIXELFORMAT_RGB888,
|
||||
SDL_PIXELFORMAT_BGR888,
|
||||
SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_RGBA8888,
|
||||
SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_BGRA8888,
|
||||
SDL_PIXELFORMAT_YV12,
|
||||
SDL_PIXELFORMAT_YUY2,
|
||||
SDL_PIXELFORMAT_UYVY,
|
||||
SDL_PIXELFORMAT_YVYU},
|
||||
0,
|
||||
0}
|
||||
};
|
||||
|
||||
static SDL_Renderer *
|
||||
gf_createrenderer(SDL_Window * window, Uint32 flags)
|
||||
{
|
||||
SDL_VideoDisplay *display = window->display;
|
||||
SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
|
||||
SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
|
||||
SDL_Renderer *renderer = NULL;
|
||||
SDL_RenderData *rdata = NULL;
|
||||
uint32_t it;
|
||||
int32_t jt;
|
||||
int32_t status;
|
||||
|
||||
/* Check if it is OpenGL ES window */
|
||||
if ((window->flags & SDL_WINDOW_OPENGL) == SDL_WINDOW_OPENGL) {
|
||||
/* No error, just no need to create 2D renderer for OpenGL ES window */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allocate new renderer structure */
|
||||
renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(SDL_Renderer));
|
||||
if (renderer == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allocate renderer data */
|
||||
rdata = (SDL_RenderData *) SDL_calloc(1, sizeof(SDL_RenderData));
|
||||
if (rdata == NULL) {
|
||||
SDL_free(renderer);
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
renderer->DisplayModeChanged = gf_displaymodechanged;
|
||||
renderer->ActivateRenderer = gf_activaterenderer;
|
||||
renderer->CreateTexture = gf_createtexture;
|
||||
renderer->QueryTexturePixels = gf_querytexturepixels;
|
||||
renderer->UpdateTexture = gf_updatetexture;
|
||||
renderer->LockTexture = gf_locktexture;
|
||||
renderer->UnlockTexture = gf_unlocktexture;
|
||||
renderer->DirtyTexture = gf_dirtytexture;
|
||||
renderer->RenderPoint = gf_renderpoint;
|
||||
renderer->RenderLine = gf_renderline;
|
||||
renderer->RenderFill = gf_renderfill;
|
||||
renderer->RenderCopy = gf_rendercopy;
|
||||
renderer->RenderPresent = gf_renderpresent;
|
||||
renderer->DestroyTexture = gf_destroytexture;
|
||||
renderer->DestroyRenderer = gf_destroyrenderer;
|
||||
renderer->info = gf_renderdriver.info;
|
||||
renderer->window = window;
|
||||
renderer->driverdata = rdata;
|
||||
|
||||
/* Set render acceleration flag in case it is accelerated */
|
||||
if ((didata->caps & SDL_GF_ACCELERATED) == SDL_GF_ACCELERATED) {
|
||||
renderer->info.flags = SDL_RENDERER_ACCELERATED;
|
||||
} else {
|
||||
renderer->info.flags &= ~(SDL_RENDERER_ACCELERATED);
|
||||
}
|
||||
|
||||
rdata->window = window;
|
||||
|
||||
/* Check if upper level requested synchronization on vsync signal */
|
||||
if ((flags & SDL_RENDERER_PRESENTVSYNC) == SDL_RENDERER_PRESENTVSYNC) {
|
||||
rdata->enable_vsync = SDL_TRUE;
|
||||
} else {
|
||||
rdata->enable_vsync = SDL_FALSE;
|
||||
}
|
||||
|
||||
/* Check what buffer copy/flip scheme is requested */
|
||||
rdata->surfaces_count = 0;
|
||||
if ((flags & SDL_RENDERER_SINGLEBUFFER) == SDL_RENDERER_SINGLEBUFFER) {
|
||||
if ((flags & SDL_RENDERER_PRESENTDISCARD) ==
|
||||
SDL_RENDERER_PRESENTDISCARD) {
|
||||
renderer->info.flags |=
|
||||
SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD;
|
||||
} else {
|
||||
renderer->info.flags |=
|
||||
SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY;
|
||||
}
|
||||
rdata->surfaces_count = 1;
|
||||
rdata->surface_visible_idx = 0;
|
||||
rdata->surface_render_idx = 0;
|
||||
} else {
|
||||
if ((flags & SDL_RENDERER_PRESENTFLIP2) == SDL_RENDERER_PRESENTFLIP2) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
|
||||
rdata->surfaces_count = 2;
|
||||
rdata->surface_visible_idx = 0;
|
||||
rdata->surface_render_idx = 1;
|
||||
} else {
|
||||
if ((flags & SDL_RENDERER_PRESENTFLIP3) ==
|
||||
SDL_RENDERER_PRESENTFLIP3) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
|
||||
rdata->surfaces_count = 3;
|
||||
rdata->surface_visible_idx = 0;
|
||||
rdata->surface_render_idx = 1;
|
||||
} else {
|
||||
renderer->info.flags |=
|
||||
SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY;
|
||||
rdata->surfaces_count = 1;
|
||||
rdata->surface_visible_idx = 0;
|
||||
rdata->surface_render_idx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Create layer surfaces, which could be visible */
|
||||
for (it = 0; it < rdata->surfaces_count; it++) {
|
||||
/* TODO: add palette creation */
|
||||
|
||||
/* Create displayable surfaces */
|
||||
status =
|
||||
gf_surface_create_layer(&rdata->surface[it], &didata->layer, 1, 0,
|
||||
didata->current_mode.w,
|
||||
didata->current_mode.h,
|
||||
qnxgf_sdl_to_gf_pixelformat(didata->
|
||||
current_mode.
|
||||
format), NULL,
|
||||
GF_SURFACE_CREATE_2D_ACCESSIBLE);
|
||||
|
||||
if (status != GF_ERR_OK) {
|
||||
/* Free already allocated surfaces */
|
||||
for (jt = it - 1; jt > 0; jt--) {
|
||||
gf_surface_free(rdata->surface[jt]);
|
||||
rdata->surface[jt] = NULL;
|
||||
}
|
||||
SDL_free(rdata);
|
||||
SDL_free(renderer);
|
||||
if (status == GF_ERR_MEM) {
|
||||
SDL_SetError("unsufficient free video memory");
|
||||
} else {
|
||||
SDL_SetError("error during displayable surface creation");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Get detailed information about allocated surface */
|
||||
gf_surface_get_info(rdata->surface[it], &rdata->surface_info[it]);
|
||||
}
|
||||
|
||||
return renderer;
|
||||
}
|
||||
|
||||
void
|
||||
gf_addrenderdriver(_THIS)
|
||||
{
|
||||
uint32_t it;
|
||||
|
||||
for (it = 0; it < _this->num_displays; it++) {
|
||||
SDL_AddRenderDriver(&_this->displays[it], &gf_renderdriver);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* SDL render interface */
|
||||
/****************************************************************************/
|
||||
static int
|
||||
gf_displaymodechanged(SDL_Renderer * renderer)
|
||||
{
|
||||
SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
|
||||
|
||||
/* Remove all allocated surfaces, they are no more valid */
|
||||
|
||||
/* TODO: Add video mode change detection and new parameters detection */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gf_activaterenderer(SDL_Renderer * renderer)
|
||||
{
|
||||
SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
|
||||
SDL_VideoDisplay *display = rdata->window->display;
|
||||
SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
|
||||
|
||||
/* Setup current surface as visible */
|
||||
// gf_layer_set_surfaces(didata->layer, &rdata->surface[rdata->surface_visible_idx], 1);
|
||||
|
||||
/* Set visible surface when hardware in idle state */
|
||||
// gf_layer_update(didata->layer, GF_LAYER_UPDATE_NO_WAIT_IDLE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gf_createtexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{
|
||||
SDL_RenderData *renderdata = (SDL_RenderData *) renderer->driverdata;
|
||||
SDL_Window *window = SDL_GetWindowFromID(renderer->window);
|
||||
SDL_VideoDisplay *display = window->display;
|
||||
SDL_TextureData *tdata = NULL;
|
||||
|
||||
/* Allocate texture driver data */
|
||||
tdata = (SDL_TextureData *) SDL_calloc(1, sizeof(SDL_TextureData));
|
||||
if (tdata == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set texture driver data */
|
||||
texture->driverdata = tdata;
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
gf_querytexturepixels(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
void **pixels, int *pitch)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
gf_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect, const void *pixels, int pitch)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
gf_locktexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect, int markDirty, void **pixels,
|
||||
int *pitch)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gf_unlocktexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gf_dirtytexture(SDL_Renderer * renderer, SDL_Texture * texture, int numrects,
|
||||
const SDL_Rect * rects)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
gf_renderpoint(SDL_Renderer * renderer, int x, int y)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
gf_renderline(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
gf_renderfill(SDL_Renderer * renderer, const SDL_Rect * rect)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
gf_rendercopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * srcrect, const SDL_Rect * dstrect)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gf_renderpresent(SDL_Renderer * renderer)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gf_destroytexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gf_destroyrenderer(SDL_Renderer * renderer)
|
||||
{
|
||||
SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
|
||||
uint32_t it;
|
||||
|
||||
for (it = 0; it < rdata->surfaces_count; it++) {
|
||||
if (rdata->surface[it] != NULL) {
|
||||
gf_surface_free(rdata->surface[it]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
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: */
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
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_HIDDI_JOYSTICK_H__
|
||||
#define __SDL_HIDDI_JOYSTICK_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#endif /* __SDL_HIDDI_JOYSTICK_H__ */
|
|
@ -1,159 +0,0 @@
|
|||
/*
|
||||
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_HIDDI_KEYBOARD_H__
|
||||
#define __SDL_HIDDI_KEYBOARD_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/* PS/2 and USB keyboards are generating this packet */
|
||||
typedef struct key_packet
|
||||
{
|
||||
uint8_t modifiers;
|
||||
uint8_t data;
|
||||
uint8_t codes[6];
|
||||
} key_packet;
|
||||
|
||||
/* Key modifier codes */
|
||||
#define HIDDI_MKEY_LEFT_CTRL 0x00000001
|
||||
#define HIDDI_MKEY_LEFT_SHIFT 0x00000002
|
||||
#define HIDDI_MKEY_LEFT_ALT 0x00000004
|
||||
#define HIDDI_MKEY_LEFT_WFLAG 0x00000008
|
||||
#define HIDDI_MKEY_RIGHT_CTRL 0x00000010
|
||||
#define HIDDI_MKEY_RIGHT_SHIFT 0x00000020
|
||||
#define HIDDI_MKEY_RIGHT_ALT 0x00000040
|
||||
#define HIDDI_MKEY_RIGHT_WFLAG 0x00000080
|
||||
|
||||
/* Key codes */
|
||||
#define HIDDI_KEY_UNPRESSED 0x00000000
|
||||
#define HIDDI_KEY_OVERFLOW 0x00000001
|
||||
#define HIDDI_KEY_ESC 0x00000029
|
||||
#define HIDDI_KEY_F1 0x0000003A
|
||||
#define HIDDI_KEY_F2 0x0000003B
|
||||
#define HIDDI_KEY_F3 0x0000003C
|
||||
#define HIDDI_KEY_F4 0x0000003D
|
||||
#define HIDDI_KEY_F5 0x0000003E
|
||||
#define HIDDI_KEY_F6 0x0000003F
|
||||
#define HIDDI_KEY_F7 0x00000040
|
||||
#define HIDDI_KEY_F8 0x00000041
|
||||
#define HIDDI_KEY_F9 0x00000042
|
||||
#define HIDDI_KEY_F10 0x00000043
|
||||
#define HIDDI_KEY_F11 0x00000044
|
||||
#define HIDDI_KEY_F12 0x00000045
|
||||
|
||||
#define HIDDI_KEY_BACKQUOTE 0x00000035
|
||||
#define HIDDI_KEY_1 0x0000001E
|
||||
#define HIDDI_KEY_2 0x0000001F
|
||||
#define HIDDI_KEY_3 0x00000020
|
||||
#define HIDDI_KEY_4 0x00000021
|
||||
#define HIDDI_KEY_5 0x00000022
|
||||
#define HIDDI_KEY_6 0x00000023
|
||||
#define HIDDI_KEY_7 0x00000024
|
||||
#define HIDDI_KEY_8 0x00000025
|
||||
#define HIDDI_KEY_9 0x00000026
|
||||
#define HIDDI_KEY_0 0x00000027
|
||||
#define HIDDI_KEY_MINUS 0x0000002D
|
||||
#define HIDDI_KEY_EQUAL 0x0000002E
|
||||
#define HIDDI_KEY_BACKSPACE 0x0000002A
|
||||
|
||||
#define HIDDI_KEY_TAB 0x0000002B
|
||||
#define HIDDI_KEY_Q 0x00000014
|
||||
#define HIDDI_KEY_W 0x0000001A
|
||||
#define HIDDI_KEY_E 0x00000008
|
||||
#define HIDDI_KEY_R 0x00000015
|
||||
#define HIDDI_KEY_T 0x00000017
|
||||
#define HIDDI_KEY_Y 0x0000001C
|
||||
#define HIDDI_KEY_U 0x00000018
|
||||
#define HIDDI_KEY_I 0x0000000C
|
||||
#define HIDDI_KEY_O 0x00000012
|
||||
#define HIDDI_KEY_P 0x00000013
|
||||
#define HIDDI_KEY_LEFT_SQ_BRACKET 0x0000002F
|
||||
#define HIDDI_KEY_RIGHT_SQ_BRACKET 0x00000030
|
||||
#define HIDDI_KEY_BACKSLASH 0x00000031
|
||||
|
||||
#define HIDDI_KEY_CAPSLOCK 0x00000039
|
||||
#define HIDDI_KEY_A 0x00000004
|
||||
#define HIDDI_KEY_S 0x00000016
|
||||
#define HIDDI_KEY_D 0x00000007
|
||||
#define HIDDI_KEY_F 0x00000009
|
||||
#define HIDDI_KEY_G 0x0000000A
|
||||
#define HIDDI_KEY_H 0x0000000B
|
||||
#define HIDDI_KEY_J 0x0000000D
|
||||
#define HIDDI_KEY_K 0x0000000E
|
||||
#define HIDDI_KEY_L 0x0000000F
|
||||
#define HIDDI_KEY_SEMICOLON 0x00000033
|
||||
#define HIDDI_KEY_QUOTE 0x00000034
|
||||
#define HIDDI_KEY_ENTER 0x00000028
|
||||
|
||||
#define HIDDI_KEY_Z 0x0000001D
|
||||
#define HIDDI_KEY_X 0x0000001B
|
||||
#define HIDDI_KEY_C 0x00000006
|
||||
#define HIDDI_KEY_V 0x00000019
|
||||
#define HIDDI_KEY_B 0x00000005
|
||||
#define HIDDI_KEY_N 0x00000011
|
||||
#define HIDDI_KEY_M 0x00000010
|
||||
#define HIDDI_KEY_COMMA 0x00000036
|
||||
#define HIDDI_KEY_POINT 0x00000037
|
||||
#define HIDDI_KEY_SLASH 0x00000038
|
||||
|
||||
#define HIDDI_KEY_SPACE 0x0000002C
|
||||
#define HIDDI_KEY_MENU 0x00000065
|
||||
|
||||
#define HIDDI_KEY_PRINTSCREEN 0x00000046
|
||||
#define HIDDI_KEY_SCROLLLOCK 0x00000047
|
||||
#define HIDDI_KEY_PAUSE 0x00000048
|
||||
|
||||
#define HIDDI_KEY_INSERT 0x00000049
|
||||
#define HIDDI_KEY_HOME 0x0000004A
|
||||
#define HIDDI_KEY_PAGEUP 0x0000004B
|
||||
#define HIDDI_KEY_DELETE 0x0000004C
|
||||
#define HIDDI_KEY_END 0x0000004D
|
||||
#define HIDDI_KEY_PAGEDOWN 0x0000004E
|
||||
|
||||
#define HIDDI_KEY_UP 0x00000052
|
||||
#define HIDDI_KEY_LEFT 0x00000050
|
||||
#define HIDDI_KEY_DOWN 0x00000051
|
||||
#define HIDDI_KEY_RIGHT 0x0000004F
|
||||
|
||||
#define HIDDI_KEY_NUMLOCK 0x00000053
|
||||
#define HIDDI_KEY_GR_SLASH 0x00000054
|
||||
#define HIDDI_KEY_GR_ASTERISK 0x00000055
|
||||
#define HIDDI_KEY_GR_MINUS 0x00000056
|
||||
#define HIDDI_KEY_GR_7 0x0000005F
|
||||
#define HIDDI_KEY_GR_8 0x00000060
|
||||
#define HIDDI_KEY_GR_9 0x00000061
|
||||
#define HIDDI_KEY_GR_PLUS 0x00000057
|
||||
#define HIDDI_KEY_GR_4 0x0000005C
|
||||
#define HIDDI_KEY_GR_5 0x0000005D
|
||||
#define HIDDI_KEY_GR_6 0x0000005E
|
||||
#define HIDDI_KEY_GR_1 0x00000059
|
||||
#define HIDDI_KEY_GR_2 0x0000005A
|
||||
#define HIDDI_KEY_GR_3 0x0000005B
|
||||
#define HIDDI_KEY_GR_ENTER 0x00000058
|
||||
#define HIDDI_KEY_GR_0 0x00000062
|
||||
#define HIDDI_KEY_GR_DELETE 0x00000063
|
||||
|
||||
#endif /* __SDL_HIDDI_KEYBOARD_H__ */
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
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_HIDDI_MOUSE_H__
|
||||
#define __SDL_HIDDI_MOUSE_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/* USB keyboard multimedia keys are generating this packet */
|
||||
typedef struct mouse_packet2
|
||||
{
|
||||
uint8_t buttons;
|
||||
int8_t wheel;
|
||||
} mouse_packet2;
|
||||
|
||||
/* PS/2 mice are generating this packet */
|
||||
typedef struct mouse_packet4
|
||||
{
|
||||
uint8_t buttons;
|
||||
int8_t horizontal;
|
||||
int8_t vertical;
|
||||
int8_t wheel;
|
||||
} mouse_packet4;
|
||||
|
||||
/* USB keyboard with mice wheel onboard generating this packet */
|
||||
typedef struct mouse_packet5
|
||||
{
|
||||
uint8_t buttons;
|
||||
int8_t horizontal;
|
||||
int8_t vertical;
|
||||
int8_t wheel;
|
||||
uint8_t state;
|
||||
} mouse_packet5;
|
||||
|
||||
/* USB multi-button mice are generating this packet */
|
||||
typedef struct mouse_packet8
|
||||
{
|
||||
uint8_t buttons;
|
||||
int8_t horizontal;
|
||||
int8_t vertical;
|
||||
int8_t wheel;
|
||||
int16_t horizontal_precision;
|
||||
int16_t vertical_precision;
|
||||
} mouse_packet8;
|
||||
|
||||
#endif /* __SDL_HIDDI_MOUSE_H__ */
|
File diff suppressed because it is too large
Load diff
|
@ -1,161 +0,0 @@
|
|||
/*
|
||||
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_QNXGF_H__
|
||||
#define __SDL_QNXGF_H__
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#include <gf/gf.h>
|
||||
#include <gf/gf3d.h>
|
||||
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
#include <GLES/egl.h>
|
||||
#endif /* SDL_VIDEO_OPENGL_ES */
|
||||
|
||||
typedef struct SDL_VideoData
|
||||
{
|
||||
gf_dev_t gfdev; /* GF device handle */
|
||||
gf_dev_info_t gfdev_info; /* GF device information */
|
||||
SDL_bool gfinitialized; /* GF device initialization status */
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
EGLDisplay egldisplay; /* OpenGL ES display connection */
|
||||
uint32_t egl_refcount; /* OpenGL ES reference count */
|
||||
uint32_t swapinterval; /* OpenGL ES default swap interval */
|
||||
#endif /* SDL_VIDEO_OPENGL_ES */
|
||||
} SDL_VideoData;
|
||||
|
||||
#define SDL_VIDEO_GF_DEVICENAME_MAX 257
|
||||
#define SDL_VIDEO_GF_MAX_CURSOR_SIZE 128
|
||||
|
||||
typedef struct SDL_DisplayData
|
||||
{
|
||||
gf_display_info_t display_info; /* GF display information */
|
||||
gf_display_t display; /* GF display handle */
|
||||
uint32_t custom_refresh; /* Custom refresh rate for all modes */
|
||||
SDL_DisplayMode current_mode; /* Current video mode */
|
||||
uint8_t description[SDL_VIDEO_GF_DEVICENAME_MAX];
|
||||
/* Device description */
|
||||
uint32_t caps; /* Device capabilities */
|
||||
SDL_bool layer_attached; /* Layer attach status */
|
||||
gf_layer_t layer; /* Graphics layer to which attached */
|
||||
gf_surface_t surface[3]; /* Visible surface on the display */
|
||||
SDL_bool cursor_visible; /* SDL_TRUE if cursor visible */
|
||||
gf_cursor_t cursor; /* Cursor shape which was set last */
|
||||
} SDL_DisplayData;
|
||||
|
||||
/* Maximum amount of OpenGL ES framebuffer configurations */
|
||||
#define SDL_VIDEO_GF_OPENGLES_CONFS 32
|
||||
|
||||
typedef struct SDL_WindowData
|
||||
{
|
||||
SDL_bool uses_gles; /* true if window support OpenGL ES */
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
gf_3d_target_t target; /* OpenGL ES window target */
|
||||
SDL_bool target_created; /* GF 3D target is created if true */
|
||||
EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS];
|
||||
/* OpenGL ES framebuffer confs */
|
||||
EGLint gles_config; /* Config index in the array of cfgs */
|
||||
EGLContext gles_context; /* OpenGL ES context */
|
||||
EGLint gles_attributes[256]; /* OpenGL ES attributes for context */
|
||||
EGLSurface gles_surface; /* OpenGL ES target rendering surface */
|
||||
#endif /* SDL_VIDEO_OPENGL_ES */
|
||||
} SDL_WindowData;
|
||||
|
||||
typedef struct SDL_GLDriverData
|
||||
{
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
#endif /* SDL_VIDEO_OPENGL_ES */
|
||||
} SDL_GLDriverData;
|
||||
|
||||
/****************************************************************************/
|
||||
/* Low level GF graphics driver capabilities */
|
||||
/****************************************************************************/
|
||||
typedef struct GF_DeviceCaps
|
||||
{
|
||||
uint8_t *name;
|
||||
uint32_t caps;
|
||||
} GF_DeviceCaps;
|
||||
|
||||
#define SDL_GF_UNACCELERATED 0x00000000 /* driver is unaccelerated */
|
||||
#define SDL_GF_ACCELERATED 0x00000001 /* driver is accelerated */
|
||||
#define SDL_GF_NOLOWRESOLUTION 0x00000000 /* no modes below 640x480 */
|
||||
#define SDL_GF_LOWRESOLUTION 0x00000002 /* support modes <640x480 */
|
||||
#define SDL_GF_UNACCELERATED_3D 0x00000000 /* software OpenGL ES */
|
||||
#define SDL_GF_ACCELERATED_3D 0x00000004 /* hardware acc. OpenGL ES */
|
||||
#define SDL_GF_NOVIDEOMEMORY 0x00000000 /* no video memory alloc. */
|
||||
#define SDL_GF_VIDEOMEMORY 0x00000008 /* has video memory alloc. */
|
||||
|
||||
/****************************************************************************/
|
||||
/* SDL_VideoDevice functions declaration */
|
||||
/****************************************************************************/
|
||||
|
||||
/* Display and window functions */
|
||||
int qnxgf_videoinit(_THIS);
|
||||
void qnxgf_videoquit(_THIS);
|
||||
void qnxgf_getdisplaymodes(_THIS);
|
||||
int qnxgf_setdisplaymode(_THIS, SDL_DisplayMode * mode);
|
||||
int qnxgf_setdisplaygammaramp(_THIS, Uint16 * ramp);
|
||||
int qnxgf_getdisplaygammaramp(_THIS, Uint16 * ramp);
|
||||
int qnxgf_createwindow(_THIS, SDL_Window * window);
|
||||
int qnxgf_createwindowfrom(_THIS, SDL_Window * window, const void *data);
|
||||
void qnxgf_setwindowtitle(_THIS, SDL_Window * window);
|
||||
void qnxgf_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
|
||||
void qnxgf_setwindowposition(_THIS, SDL_Window * window);
|
||||
void qnxgf_setwindowsize(_THIS, SDL_Window * window);
|
||||
void qnxgf_showwindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_hidewindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_raisewindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_maximizewindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_minimizewindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_restorewindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_setwindowgrab(_THIS, SDL_Window * window);
|
||||
void qnxgf_destroywindow(_THIS, SDL_Window * window);
|
||||
|
||||
/* Window manager function */
|
||||
SDL_bool qnxgf_getwindowwminfo(_THIS, SDL_Window * window,
|
||||
struct SDL_SysWMinfo *info);
|
||||
|
||||
/* OpenGL/OpenGL ES functions */
|
||||
int qnxgf_gl_loadlibrary(_THIS, const char *path);
|
||||
void *qnxgf_gl_getprocaddres(_THIS, const char *proc);
|
||||
void qnxgf_gl_unloadlibrary(_THIS);
|
||||
SDL_GLContext qnxgf_gl_createcontext(_THIS, SDL_Window * window);
|
||||
int qnxgf_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
||||
int qnxgf_gl_setswapinterval(_THIS, int interval);
|
||||
int qnxgf_gl_getswapinterval(_THIS);
|
||||
void qnxgf_gl_swapwindow(_THIS, SDL_Window * window);
|
||||
void qnxgf_gl_deletecontext(_THIS, SDL_GLContext context);
|
||||
|
||||
/* Event handling function */
|
||||
void qnxgf_pumpevents(_THIS);
|
||||
|
||||
/* Screen saver related function */
|
||||
void qnxgf_suspendscreensaver(_THIS);
|
||||
|
||||
#endif /* __SDL_QNXGF_H__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -116,10 +116,6 @@ main(int argc, char *argv[])
|
|||
/* you may want to change these according to the platform */
|
||||
video_w = 320;
|
||||
video_h = 480;
|
||||
#ifdef __QNXNTO__
|
||||
video_w = 480;
|
||||
video_h = 640;
|
||||
#endif /* __QNXNTO__ */
|
||||
|
||||
if (argv[1]) {
|
||||
gl_library = argv[1];
|
||||
|
@ -151,12 +147,7 @@ main(int argc, char *argv[])
|
|||
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);
|
||||
#endif /* __QNXNTO__ */
|
||||
|
||||
f.glMatrixMode(GL_PROJECTION);
|
||||
f.glLoadIdentity();
|
||||
f.glOrthof(-100, 100, -100, 100, -500, 500);
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
#endif
|
||||
|
||||
#define DEFAULT_PTSIZE 30
|
||||
#ifdef __QNXNTO__
|
||||
#define DEFAULT_FONT "/usr/photon/font_repository/tt0003m_.ttf"
|
||||
#else
|
||||
#define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf"
|
||||
#endif
|
||||
#define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf"
|
||||
#define MAX_TEXT_LENGTH 256
|
||||
|
||||
SDL_Surface *screen;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue