Commit e87963bb authored by Sam Lantinga's avatar Sam Lantinga

Date: Mon, 2 Mar 2009 16:27:42 +0200

From: "Mike Gorchak"
Subject: About QNX support in SDL 1.3

Right now I'm working on QNX SDL 1.3 drivers implementation and looks like a
lot of code must be completely reworked. But I'm ready for it :) Also I want
to add QNX Graphics Framework SDL driver, which is fullscreen graphics
framework, with support of hardware accelerated OpenGL ES implementations.
This Graphics Framework (called GF in QNX) could also use QNX Photon (window
manager GUI) as window manager.

In the attachment initial patch for QNX support in SDL 1.3

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403549
parent 89b23cc7
README.QNX by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua> README.QNX by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
Last changed at 24 Apr 2004. Last changed at 02 Mar 2009.
====================================================================== QNX Photon and GF drivers are under construction. Please be patient.
Table of Contents:
1. OpenGL.
2. Wheel and multi-button mouses.
3. CDROM handling issues.
4. Hardware video overlays.
5. Shared library building.
6. Some building issues.
7. Environment variables.
======================================================================
1. OpenGL:
OpenGL works well and is stable, but fullscreen mode has not been
heavily tested yet.
If you have QNX RtP version 6.1.0 or above you must download the
Photon3D runtime from http://developers.qnx.com or install it from the
public repository or from the public CD, available with QNX. OS versi-
ons below 6.1.0 are not supported.
When creating an OpenGL context, software renderer mode is artifi-
cially selected (QSSL made acceleration only for Voodoo boards in
fullscreen mode, sorry but I don't have this board to test OpenGL -
maybe it works or maybe not :)). If you want acceleration - you can
remove one line in the source code: find the file SDL_ph_image.c and
remove the following
OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
line in the ph_SetupOpenGLContext() function or change the argument to
PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW.
======================================================================
2. Wheel and multi-button mouses:
Photon emits keyboard events (key up and down) when the mouse
wheel is moved. The key_scan field appears valid, and it contains zero.
That is a basic method of detecting mouse wheel events under Photon.
It looks like a hack, but it works for me :) on various PC configura-
tions.
I've tested it on:
1. Genius Optical NetScroll/+ PS/2 (1 wheel)
2. A4Tech Optical GreatEye WheelMouse PS/2, model: WOP-35. (2 wheels
+ 2 additional buttons). The wheel for vertical scrolling works as
usual, but the second wheel for horizontal scrolling emits two se-
quential events up or down, so it can provide faster scrolling than
the first wheel. Additional buttons don't emit any events, but it
looks like they're handled by photon in an unusual way - like click
to front, but works not with any window, looks like a fun bug-o-fe-
ature :).
======================================================================
3. CDROM handling issues:
Access to CDROM can only be provided with 'root' privileges. I
can't do anything about that, /dev/cd0 has brw------- permissions and
root:root rights.
======================================================================
4. Hardware video overlays:
Overlays can flicker during window movement, resizing, etc. It
happens because the photon driver updates the real window contents be-
hind the overlay, then draws the temporary chroma key color over the
window contents. It can be done without using the chroma key but that
causes the overlay to always be on top. So flickering during window
movement is preferred instead.
Double buffering code is temporarily disabled in the photon driver
code, because on my GF2-MX it can accidentally cause a buffer switch,
which causes the old frame to show. S3 Savage4 has the same problem,
but ATI Rage 128 doesn't. I think it can be fixed later. Current code
works very well, so maybe double buffering is not needed right now.
Something strange happens when you try to move the window with the
overlay beyond the left border of the screen. The overlay tries to
stay at position x=0, but when attempting to move it a bit more it
jumps to position x=-60 (on GF2-MX, on ATI Rage128 this value a bit
smaller). It's really strange, looks like the overlay doesn't like
negative coordinates.
=======================================================================
5. Shared library building:
A shared library can be built, but before running the autogen.sh
script you must manually delete the libtool.m4 stuff from the acinclu-
de.m4 file (it comes after the ESD detection code up to the end of the
file), because the libtool stuff in the acinclude.m4 file was very old
in SDL distribution before the version 1.2.7 and doesn't knew anything
about QNX. SDL 1.2.7 distribution contains the new libtool.m4 script,
but anyway it is broken :), Just remove it, then run "libtoolize
--force --copy", delete the file aclocal.m4 if it is exists and after
that run the autogen.sh script. SDL 1.2.8 contains fixed libtool.m4,
ltmain.sh and config.sub files, so you can just run the autogen.sh
script.
======================================================================
6. Some building issues:
Feel free to not use the --disable-shared configure option if you'
ve read the above comment about 'Shared library building'. Otherwise
this option is strongly recommended, as without it the sdl-config
script will be broken.
Run the configure script without x11 support, e.g.:
a) for OpenGL support:
./configure --prefix=/usr \
--disable-video-x11 \
--disable-shared
b) without OpenGL support:
./configure --prefix=/usr \
--disable-video-x11 \
--disable-shared \
--disable-video-opengl
And of course dont forget to specify --disable-debug, which is on
by default, to disable debug and enable the expensive optimizations.
In the test directory also run the ./configure script without
x11 support, e.g.:
./configure --with-sdl-prefix=/usr \
--with-sdl-exec-prefix=/usr \
--prefix=/usr --without-x
======================================================================
7. Environment variables:
Please note that the photon driver is sensible to the following
environmental variables:
* SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls
the refresh rate in all fullscreen modes. Be carefull !!! Photon
drivers usually do not checking the maximum refresh rate, which video
adapter or monitor supports.
* SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y
coordinates are bigger than the current desktop resolution, then win-
dow positioning across virtual consoles is activated. If X and Y are
smaller than the desktop resolution then window positioning in the
current console is activated. The word "center" can be used instead of
coordinates, it produces the same behavior as SDL_VIDEO_CENTERED
environmental variable.
* SDL_VIDEO_CENTERED - if this environmental variable exists then the
window centering is perfomed in the current virtual console.
Notes: The SDL_VIDEO_CENTERED enviromental variable has greater pri-
ority than the SDL_VIDEO_WINDOW_POS in case if both variables are sup-
plied to the application.
<QPG:Generation>
<QPG:Options>
<QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
<QPG:Defaults type="qnx_package"/>
<QPG:Source></QPG:Source>
<QPG:Release date="today" number="+"/>
<QPG:Build></QPG:Build>
<QPG:FileSorting strip="yes"/>
<QPG:Package targets="standart"/>
<QPG:Repository generate="yes"/>
<QPG:FinalDir></QPG:FinalDir>
<QPG:Cleanup></QPG:Cleanup>
</QPG:Options>
<QPG:Responsible>
<QPG:Company>QNX.ORG.RU Community</QPG:Company>
<QPG:Department></QPG:Department>
<QPG:Group></QPG:Group>
<QPG:Team>QNX.ORG.RU Team</QPG:Team>
<QPG:Employee>Mike Gorchak</QPG:Employee>
<QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
</QPG:Responsible>
<QPG:Values>
<QPG:Files>
<QPG:Add file="./COPYING" install="LicenseUrl/" handling="repdata"/>
<QPG:Add permissions="0755" file="./src/.libs/libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@" install="/usr/lib/"/>
<QPG:Add filetype="symlink" file="libSDL.so" install="/usr/lib/" linkto="libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@"/>
<QPG:Add permissions="0644" file="./src/.libs/libSDL.a" install="/usr/lib/"/>
<QPG:Add permissions="0644" file="./src/.libs/libSDL.lai" install="/usr/lib/libSDL.la"/>
<QPG:Add permissions="0644" file="./src/main/libSDLmain.a" install="/usr/lib/"/>
<QPG:Add permissions="0644" file="./include/*.h" install="/usr/include/SDL/"/>
<QPG:Add permissions="0755" file="./sdl-config" install="/usr/bin/"/>
<QPG:Add permissions="0644" file="./BUGS" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./COPYING" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./CREDITS" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./INSTALL" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./README" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./README-SDL.txt" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./README.CVS" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./README.QNX" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./TODO" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./WhatsNew" install="/usr/share/doc/SDL12/"/>
<QPG:Add permissions="0644" file="./docs.html" install="/usr/share/doc/SDL12/Changes.html"/>
<QPG:Add permissions="0644" file="./docs/index.html" install="/usr/share/doc/SDL12/docs/"/>
<QPG:Add permissions="0644" file="./docs/html/*.html" install="/usr/share/doc/SDL12/docs/html/"/>
<QPG:Add permissions="0644" file="./docs/man3/*.3" install="/usr/share/man/man3/"/>
<QPG:Add permissions="0644" file="./sdl.m4" install="/usr/share/aclocal/"/>
</QPG:Files>
<QPG:PackageFilter>
<QPM:PackageManifest>
<QPM:PackageDescription>
<QPM:PackageType>Library</QPM:PackageType>
<QPM:PackageName>SDL</QPM:PackageName>
<QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
<QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
<QPM:FileVersion>2.6</QPM:FileVersion>
</QPM:PackageDescription>
<QPM:ProductDescription>
<QPM:ProductName>Simple DirectMedia Layer (SDL)</QPM:ProductName>
<QPM:ProductIdentifier>SDL</QPM:ProductIdentifier>
<QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
<QPM:VendorName>Public</QPM:VendorName>
<QPM:VendorInstallName>public</QPM:VendorInstallName>
<QPM:VendorURL>http://www.libsdl.org</QPM:VendorURL>
<QPM:VendorEmbedURL/>
<QPM:VendorEmail>slouken@libsdl.org</QPM:VendorEmail>
<QPM:AuthorName>Sam Lantinga</QPM:AuthorName>
<QPM:AuthorURL>http://www.libsdl.org</QPM:AuthorURL>
<QPM:AuthorEmbedURL/>
<QPM:AuthorEmail>slouken@libsdl.org</QPM:AuthorEmail>
<QPM:ProductIconSmall/>
<QPM:ProductIconLarge/>
<QPM:ProductDescriptionShort>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</QPM:ProductDescriptionShort>
<QPM:ProductDescriptionLong>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications.</QPM:ProductDescriptionLong>
<QPM:ProductDescriptionURL>http://www.libsdl.org</QPM:ProductDescriptionURL>
<QPM:ProductDescriptionEmbedURL/>
</QPM:ProductDescription>
<QPM:ReleaseDescription>
<QPM:ReleaseVersion>@VERSION@</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor/>
<QPM:ReleaseNoteMajor/>
<QPM:ReleaseBuild>1</QPM:ReleaseBuild>
<QPM:CountryExclude/>
<QPM:ReleaseCopyright>GNU Lesser General Public License</QPM:ReleaseCopyright>
</QPM:ReleaseDescription>
<QPM:ContentDescription>
<QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
<QPM:ContentKeyword>SDL,audio,graphics,demos,games,emulators,direct,media,layer</QPM:ContentKeyword>
<QPM:TargetOS>qnx6</QPM:TargetOS>
<QPM:HostOS>none</QPM:HostOS>
<QPM:DisplayEnvironment xmlmultiple="true">Photon</QPM:DisplayEnvironment>
<QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
<QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
<QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
</QPM:ContentDescription>
<QPM:LicenseUrl>repdata://LicenseUrl/COPYING</QPM:LicenseUrl>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="none" target="none">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="x86" target="none">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="none" target="x86">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="x86" target="x86">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
</QPG:Values>
</QPG:Generation>
...@@ -1256,6 +1256,35 @@ AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=y ...@@ -1256,6 +1256,35 @@ AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=y
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"
have_video=yes
CheckOpenGLESQNX
fi
fi
}
dnl Set up the BWindow video driver if enabled dnl Set up the BWindow video driver if enabled
CheckBWINDOW() CheckBWINDOW()
{ {
...@@ -1639,11 +1668,11 @@ CheckOpenGLX11() ...@@ -1639,11 +1668,11 @@ CheckOpenGLX11()
fi fi
} }
dnl Find QNX RtP OpenGL dnl Find QNX 6.x Software OpenGL
CheckOpenGLQNX() CheckOpenGLQNX()
{ {
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
AC_MSG_CHECKING(for OpenGL (Photon) support) AC_MSG_CHECKING(for QNX 6.x Photon OpenGL support)
video_opengl=no video_opengl=no
AC_TRY_COMPILE([ AC_TRY_COMPILE([
#include <GL/gl.h> #include <GL/gl.h>
...@@ -1660,6 +1689,43 @@ CheckOpenGLQNX() ...@@ -1660,6 +1689,43 @@ CheckOpenGLQNX()
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([
#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_CL"
fi
fi
fi
}
dnl Check for Win32 OpenGL dnl Check for Win32 OpenGL
CheckWIN32GL() CheckWIN32GL()
{ {
...@@ -2406,16 +2472,27 @@ case "$host" in ...@@ -2406,16 +2472,27 @@ case "$host" in
fi fi
;; ;;
*-*-qnx*) *-*-qnx*)
EXTRA_CFLAGS="-I/usr/include $CFLAGS"
EXTRA_LDLAGS="-L/usr/lib $LDFLAGS"
ARCH=qnx ARCH=qnx
CheckVisibilityHidden
CheckDummyVideo CheckDummyVideo
CheckDiskAudio CheckDiskAudio
CheckDummyAudio CheckDummyAudio
CheckDLOPEN CheckDLOPEN
CheckPulseAudio
CheckESD
CheckNAS CheckNAS
CheckPHOTON CheckPHOTON
CheckQNXGF
CheckX11 CheckX11
CheckOpenGLX11 CheckOpenGLX11
CheckPTHREAD CheckPTHREAD
CheckClockGettime
# Set up files for the audio library # Set up files for the audio library
if test x$enable_audio = xyes; then if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO) AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
...@@ -2435,6 +2512,18 @@ case "$host" in ...@@ -2435,6 +2512,18 @@ case "$host" in
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
have_timers=yes have_timers=yes
fi 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
;; ;;
*-*-cygwin* | *-*-mingw32*) *-*-cygwin* | *-*-mingw32*)
ARCH=win32 ARCH=win32
...@@ -2865,7 +2954,7 @@ AC_SUBST(EXTRA_LDFLAGS) ...@@ -2865,7 +2954,7 @@ AC_SUBST(EXTRA_LDFLAGS)
AC_SUBST(WINDRES) AC_SUBST(WINDRES)
AC_OUTPUT([ AC_OUTPUT([
Makefile sdl-config SDL.spec SDL.qpg sdl.pc Makefile sdl-config SDL.spec sdl.pc
], [ ], [
: >build-deps : >build-deps
if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
......
...@@ -285,6 +285,7 @@ ...@@ -285,6 +285,7 @@
#undef SDL_VIDEO_DRIVER_NDS #undef SDL_VIDEO_DRIVER_NDS
#undef SDL_VIDEO_DRIVER_OS2FS #undef SDL_VIDEO_DRIVER_OS2FS
#undef SDL_VIDEO_DRIVER_PHOTON #undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_QNXGF
#undef SDL_VIDEO_DRIVER_PS2GS #undef SDL_VIDEO_DRIVER_PS2GS
#undef SDL_VIDEO_DRIVER_RISCOS #undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_DRIVER_SVGALIB #undef SDL_VIDEO_DRIVER_SVGALIB
......
...@@ -40,6 +40,10 @@ extern "C" ...@@ -40,6 +40,10 @@ extern "C"
#include <OpenGLES/ES1/gl.h> /* Header File For The OpenGL ES Library */ #include <OpenGLES/ES1/gl.h> /* Header File For The OpenGL ES Library */
#endif #endif
#if defined(__QNXNTO__) && defined(SDL_VIDEO_OPENGL_ES)
#include <GLES/egl.h>
#endif
#ifndef APIENTRY #ifndef APIENTRY
#define APIENTRY #define APIENTRY
#endif #endif
......
...@@ -369,7 +369,10 @@ extern VideoBootStrap WIN32_bootstrap; ...@@ -369,7 +369,10 @@ extern VideoBootStrap WIN32_bootstrap;
extern VideoBootStrap BWINDOW_bootstrap; extern VideoBootStrap BWINDOW_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_PHOTON #if SDL_VIDEO_DRIVER_PHOTON
extern VideoBootStrap ph_bootstrap; extern VideoBootStrap photon_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_QNXGF
extern VideoBootStrap qnxgf_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_EPOC #if SDL_VIDEO_DRIVER_EPOC
extern VideoBootStrap EPOC_bootstrap; extern VideoBootStrap EPOC_bootstrap;
......
...@@ -89,7 +89,10 @@ static VideoBootStrap *bootstrap[] = { ...@@ -89,7 +89,10 @@ static VideoBootStrap *bootstrap[] = {
&BWINDOW_bootstrap, &BWINDOW_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_PHOTON #if SDL_VIDEO_DRIVER_PHOTON
&ph_bootstrap, &photon_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_QNXGF
&qnxgf_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_EPOC #if SDL_VIDEO_DRIVER_EPOC
&EPOC_bootstrap, &EPOC_bootstrap,
......
This diff is collapsed.
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#ifndef __SDL_PH_GL_H__
#define __SDL_PH_GL_H__
#include "SDL_ph_video.h"
#define DEFAULT_OPENGL "/usr/lib/libGL.so"
#if SDL_VIDEO_OPENGL
void ph_GL_SwapBuffers(_THIS);
int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
int ph_GL_LoadLibrary(_THIS, const char *path);
void *ph_GL_GetProcAddress(_THIS, const char *proc);
int ph_GL_MakeCurrent(_THIS);
int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp,
Uint32 flags);
#endif /* SDL_VIDEO_OPENGL */
#endif /* __SDL_PH_GL_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#ifndef __SDL_PH_IMAGE_H__
#define __SDL_PH_IMAGE_H__
#include "../../events/SDL_events_c.h"
#include "SDL_ph_video.h"
struct private_hwdata
{
PdOffscreenContext_t *offscreenctx;
PdOSCCreateLockParams_t crlockparam;
PdOSCLockParams_t lockparam;
Uint32 colorkey;
};
extern int ph_SetupImage(_THIS, SDL_Surface * screen);
extern void ph_DestroyImage(_THIS, SDL_Surface * screen);
extern int ph_SetupUpdateFunction(_THIS, SDL_Surface * screen, Uint32 flags);
extern int ph_AllocHWSurface(_THIS, SDL_Surface * surface);
extern void ph_FreeHWSurface(_THIS, SDL_Surface * surface);
extern int ph_CheckHWBlit(_THIS, SDL_Surface * src, SDL_Surface * dst);
extern int ph_FillHWRect(_THIS, SDL_Surface * surface, SDL_Rect * rect,
Uint32 color);
extern int ph_LockHWSurface(_THIS, SDL_Surface * surface);
extern void ph_UnlockHWSurface(_THIS, SDL_Surface * surface);
extern int ph_FlipHWSurface(_THIS, SDL_Surface * surface);
extern int ph_SetHWColorKey(_THIS, SDL_Surface * surface, Uint32 key);
extern int ph_SetHWAlpha(_THIS, SDL_Surface * surface, Uint8 alpha);
extern int ph_HWAccelBlit(SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
extern int ph_UpdateHWInfo(_THIS);
extern void ph_NormalUpdate(_THIS, int numrects, SDL_Rect * rects);
extern void ph_OCUpdate(_THIS, int numrects, SDL_Rect * rects);
extern void ph_OCDCUpdate(_THIS, int numrects, SDL_Rect * rects);
extern void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect * rects);
#endif /* __SDL_PH_IMAGE_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#ifndef __SDL_PH_MODES_H__
#define __SDL_PH_MODES_H__
#include "SDL_ph_video.h"
#define PH_MAX_VIDEOMODES 127
#define PH_ENTER_DIRECTMODE 0
#define PH_IGNORE_DIRECTMODE 1
extern SDL_Rect **ph_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags);
extern void ph_FreeVideoModes(_THIS);
extern int ph_ResizeFullScreen(_THIS);
extern int ph_EnterFullScreen(_THIS, SDL_Surface * screen, int fmode);
extern int ph_LeaveFullScreen(_THIS);
extern int ph_GetVideoMode(int width, int height, int bpp);
extern int get_mode_any_format(int width, int height, int bpp);
extern int ph_ToggleFullScreen(_THIS, int on);
#endif /* __SDL_PH_MODES_H__ */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#include "SDL_mouse.h"
#include "../../events/SDL_events_c.h"
#include "../SDL_cursor_c.h"
#include "SDL_ph_mouse_c.h"
struct WMcursor
{
PhCursorDef_t *ph_cursor;
};
void
ph_FreeWMCursor(_THIS, WMcursor * cursor)
{
if (window != NULL) {
SDL_Lock_EventThread();
if (PtSetResource(window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0)
< 0) {
/* TODO: output error msg */
}
SDL_Unlock_EventThread();
}
SDL_free(cursor);
}
WMcursor *
ph_CreateWMCursor(_THIS, Uint8 * data, Uint8 * mask, int w, int h, int hot_x,
int hot_y)
{
WMcursor *cursor;
int clen, i;
unsigned char bit, databit, maskbit;
/* Allocate and initialize the cursor memory */
if ((cursor = (WMcursor *) SDL_malloc(sizeof(WMcursor))) == NULL) {
SDL_OutOfMemory();
return (NULL);
}
SDL_memset(cursor, 0, sizeof(WMcursor));
cursor->ph_cursor =
(PhCursorDef_t *) SDL_malloc(sizeof(PhCursorDef_t) + 32 * 4 * 2);
if (cursor->ph_cursor == NULL) {
SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n");
return NULL;
}
SDL_memset(cursor->ph_cursor, 0, (sizeof(PhCursorDef_t) + 32 * 4 * 2));
cursor->ph_cursor->hdr.type = Ph_RDATA_CURSOR;
cursor->ph_cursor->size1.x = (short) w;
cursor->ph_cursor->size1.y = (short) h;
cursor->ph_cursor->offset1.x = (short) hot_x;
cursor->ph_cursor->offset1.y = (short) hot_y;
cursor->ph_cursor->bytesperline1 = (char) w / 8;
cursor->ph_cursor->color1 = Pg_WHITE;
cursor->ph_cursor->size2.x = (short) w;
cursor->ph_cursor->size2.y = (short) h;
cursor->ph_cursor->offset2.x = (short) hot_x;
cursor->ph_cursor->offset2.y = (short) hot_y;
cursor->ph_cursor->bytesperline2 = (char) w / 8;
cursor->ph_cursor->color2 = Pg_BLACK;
clen = (w / 8) * h;
/* Copy the mask and the data to different bitmap planes */
for (i = 0; i < clen; ++i) {
for (bit = 0; bit < 8; bit++) {
databit = data[i] & (1 << bit);
maskbit = mask[i] & (1 << bit);
cursor->ph_cursor->images[i] |= (databit == 0) ? maskbit : 0;
/* If the databit != 0, treat it as a black pixel and
* ignore the maskbit (can't do an inverted color) */
cursor->ph_cursor->images[i + clen] |= databit;
}
}
/* #bytes following the hdr struct */
cursor->ph_cursor->hdr.len =
sizeof(PhCursorDef_t) + clen * 2 - sizeof(PhRegionDataHdr_t);
return (cursor);
}
PhCursorDef_t
ph_GetWMPhCursor(WMcursor * cursor)
{
return (*cursor->ph_cursor);
}
int
ph_ShowWMCursor(_THIS, WMcursor * cursor)
{
PtArg_t args[3];
int nargs = 0;
/* Don't do anything if the display is gone */
if (window == NULL) {
return (0);
}
/* looks like photon can't draw mouse cursor in direct mode */
if (this->screen->flags & SDL_FULLSCREEN) {
/* disable the fake mouse in the fullscreen OpenGL mode */
if (this->screen->flags & SDL_INTERNALOPENGL) {
cursor = NULL;
} else {
return (0);
}
}
/* Set the photon cursor, or blank if cursor is NULL */
if (cursor != NULL) {
PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0);
/* Could set next to any PgColor_t value */
PtSetArg(&args[1], Pt_ARG_CURSOR_COLOR, Ph_CURSOR_DEFAULT_COLOR, 0);
PtSetArg(&args[2], Pt_ARG_BITMAP_CURSOR, cursor->ph_cursor,
(cursor->ph_cursor->hdr.len + sizeof(PhRegionDataHdr_t)));
nargs = 3;
} else { /* Ph_CURSOR_NONE */
PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0);
nargs = 1;
}
SDL_Lock_EventThread();
if (PtSetResources(window, nargs, args) < 0) {
return (0);
}
SDL_Unlock_EventThread();
return (1);
}
void
ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
short abs_x, abs_y;
SDL_Lock_EventThread();
PtGetAbsPosition(window, &abs_x, &abs_y);
PhMoveCursorAbs(PhInputGroup(NULL), x + abs_x, y + abs_y);
SDL_Unlock_EventThread();
}
void
ph_CheckMouseMode(_THIS)
{
/* If the mouse is hidden and input is grabbed, we use relative mode */
if (!(SDL_cursorstate & CURSOR_VISIBLE)
&& (this->input_grab != SDL_GRAB_OFF)) {
mouse_relative = 1;
} else {
mouse_relative = 0;
}
}
void
ph_UpdateMouse(_THIS)
{
PhCursorInfo_t phcursor;
short abs_x;
short abs_y;
/* Lock the event thread, in multi-threading environments */
SDL_Lock_EventThread();
/* synchronizing photon mouse cursor position and SDL mouse position, if cursor appears over window. */
PtGetAbsPosition(window, &abs_x, &abs_y);
PhQueryCursor(PhInputGroup(NULL), &phcursor);
if (((phcursor.pos.x >= abs_x)
&& (phcursor.pos.x <= abs_x + this->screen->w))
&& ((phcursor.pos.y >= abs_y)
&& (phcursor.pos.y <= abs_y + this->screen->h))) {
SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
SDL_PrivateMouseMotion(0, 0, phcursor.pos.x - abs_x,
phcursor.pos.y - abs_y);
} else {
SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
}
/* Unlock the event thread, in multi-threading environments */
SDL_Unlock_EventThread();
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#ifndef __SDL_PH_MOUSE_H__
#define __SDL_PH_MOUSE_H__
#include "SDL_ph_video.h"
/* Functions to be exported */
extern void ph_FreeWMCursor(_THIS, WMcursor * cursor);
extern WMcursor *ph_CreateWMCursor(_THIS,
Uint8 * data, Uint8 * mask, int w, int h,
int hot_x, int hot_y);
extern PhCursorDef_t ph_GetWMPhCursor(WMcursor * cursor);
extern int ph_ShowWMCursor(_THIS, WMcursor * cursor);
extern void ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
extern void ph_CheckMouseMode(_THIS);
extern void ph_UpdateMouse(_THIS);
#endif /* __SDL_PH_MOUSE_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef __SDL_PH_VIDEO_H__
#define __SDL_PH_VIDEO_H__
#include "SDL_mouse.h"
#include "../SDL_sysvideo.h"
#include <sys/neutrino.h>
#include <Ph.h>
#include <Pt.h>
#include <photon/Pg.h>
#include <photon/PdDirect.h>
#if SDL_VIDEO_OPENGL
#if (_NTO_VERSION < 630)
#include <photon/PdGL.h>
#else
#include <GL/qnxgl.h>
#include <GL/GLPh.h>
#endif /* 6.3.0 */
#endif /* SDL_VIDEO_OPENGL */
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice* this
#define PH_OGL_MAX_ATTRIBS 32
#define SDLPH_PAL_NONE 0x00000000L
#define SDLPH_PAL_EMULATE 0x00000001L
#define SDLPH_PAL_SYSTEM 0x00000002L
typedef struct
{
unsigned char *Y;
unsigned char *V;
unsigned char *U;
} FRAMEDATA;
/* Mask values for SDL_ReallocFormat() */
struct ColourMasks
{
Uint32 red;
Uint32 green;
Uint32 blue;
Uint32 alpha;
Uint32 bpp;
};
/* Private display data */
struct SDL_PrivateVideoData
{
PgDisplaySettings_t mode_settings;
PtWidget_t *Window; /* used to handle input events */
PhImage_t *image; /* used to display image */
#if SDL_VIDEO_OPENGL
#if (_NTO_VERSION < 630)
PdOpenGLContext_t *OGLContext; /* OpenGL context */
void *OGLBuffers; /* OpenGL buffers (unused) */
#else
qnxglc_t *OGLContext; /* OpenGL context for the 6.3 */
qnxgl_bufs_t *OGLBuffers; /* OpenGL buffers for the 6.3 */
#endif /* 630 */
Uint32 OGLFlags; /* OpenGL flags */
Uint32 OGLBPP; /* OpenGL bpp */
#endif /* SDL_VIDEO_OPENGL */
PgColor_t savedpal[_Pg_MAX_PALETTE];
PgColor_t syspalph[_Pg_MAX_PALETTE];
struct
{
PdDirectContext_t *direct_context;
PdOffscreenContext_t *offscreen_context;
PdOffscreenContext_t *offscreen_backcontext;
PhDrawContext_t *oldDC;
uint8_t *dc_ptr;
unsigned char *CurrentFrameData;
unsigned char *FrameData0;
unsigned char *FrameData1;
Uint32 current;
Uint32 flags;
} ocimage;
PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */
PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */
int old_video_mode; /* Stored mode before fullscreen switch */
int old_refresh_rate; /* Stored refresh rate befor fullscreen switch */
int mouse_relative;
WMcursor *BlankCursor;
uint32_t videomode_emulatemode;
Uint32 visualbpp; /* current visual bpp */
Uint32 desktopbpp; /* bpp of desktop at the moment of start */
Uint32 desktoppal; /* palette mode emulation or system */
int currently_fullscreen;
int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
int currently_maximized; /* 1 - window hided (minimazed), 0 - normal */
PhEvent_t *event;
SDL_Overlay *overlay;
};
#define mode_settings (this->hidden->mode_settings)
#define window (this->hidden->Window)
#define SDL_Image (this->hidden->image)
#define OCImage (this->hidden->ocimage)
#define old_video_mode (this->hidden->old_video_mode)
#define old_refresh_rate (this->hidden->old_refresh_rate)
#define graphics_card_caps (this->hidden->graphics_card_caps)
#define desktopbpp (this->hidden->desktopbpp)
#define visualbpp (this->hidden->visualbpp)
#define desktoppal (this->hidden->desktoppal)
#define savedpal (this->hidden->savedpal)
#define syspalph (this->hidden->syspalph)
#define currently_fullscreen (this->hidden->currently_fullscreen)
#define currently_hided (this->hidden->currently_hided)
#define currently_maximized (this->hidden->currently_maximized)
#define phevent (this->hidden->event)
#define current_overlay (this->hidden->overlay)
#define desktop_mode (this->hidden->desktop_mode)
#define mouse_relative (this->hidden->mouse_relative)
#define SDL_BlankCursor (this->hidden->BlankCursor)
#define videomode_emulatemode (this->hidden->videomode_emulatemode)
#if SDL_VIDEO_OPENGL
#define oglctx (this->hidden->OGLContext)
#define oglbuffers (this->hidden->OGLBuffers)
#define oglflags (this->hidden->OGLFlags)
#define oglbpp (this->hidden->OGLBPP)
#endif /* SDL_VIDEO_OPENGL */
#endif /* __SDL_PH_VIDEO_H__ */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#include <Ph.h>
#include <photon/PpProto.h>
#include <photon/PhWm.h>
#include <photon/wmapi.h>
#include "SDL_version.h"
#include "SDL_timer.h"
#include "SDL_video.h"
#include "SDL_syswm.h"
#include "../SDL_pixels_c.h"
#include "../../events/SDL_events_c.h"
#include "SDL_ph_modes_c.h"
#include "SDL_ph_wm_c.h"
void
ph_SetIcon(_THIS, SDL_Surface * icon, Uint8 * mask)
{
return;
}
/* Set window caption */
void
ph_SetCaption(_THIS, const char *title, const char *icon)
{
SDL_Lock_EventThread();
/* sanity check for set caption call before window init */
if (window != NULL) {
PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
}
SDL_Unlock_EventThread();
}
/* Iconify current window */
int
ph_IconifyWindow(_THIS)
{
PhWindowEvent_t windowevent;
SDL_Lock_EventThread();
SDL_memset(&windowevent, 0, sizeof(windowevent));
windowevent.event_f = Ph_WM_HIDE;
windowevent.event_state = Ph_WM_EVSTATE_HIDE;
windowevent.rid = PtWidgetRid(window);
PtForwardWindowEvent(&windowevent);
SDL_Unlock_EventThread();
return 0;
}
SDL_GrabMode
ph_GrabInputNoLock(_THIS, SDL_GrabMode mode)
{
short abs_x, abs_y;
if (mode == SDL_GRAB_OFF) {
PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE,
Ph_WM_STATE_ISALTKEY);
} else {
PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE,
Ph_WM_STATE_ISALTKEY);
PtGetAbsPosition(window, &abs_x, &abs_y);
PhMoveCursorAbs(PhInputGroup(NULL),
abs_x + SDL_VideoSurface->w / 2,
abs_y + SDL_VideoSurface->h / 2);
}
SDL_Unlock_EventThread();
return (mode);
}
SDL_GrabMode
ph_GrabInput(_THIS, SDL_GrabMode mode)
{
SDL_Lock_EventThread();
mode = ph_GrabInputNoLock(this, mode);
SDL_Unlock_EventThread();
return (mode);
}
int
ph_GetWMInfo(_THIS, SDL_SysWMinfo * info)
{
if (info->version.major <= SDL_MAJOR_VERSION) {
return 1;
} else {
SDL_SetError("Application not compiled with SDL %d.%d\n",
SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
return -1;
}
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#ifndef __SDL_PH_WM_H__
#define __SDL_PH_WM_H__
#include "SDL_ph_video.h"
/* Functions to be exported */
extern void ph_SetCaption(_THIS, const char *title, const char *icon);
extern void ph_SetIcon(_THIS, SDL_Surface * icon, Uint8 * mask);
extern int ph_IconifyWindow(_THIS);
extern SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode);
extern SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode);
extern int ph_GetWMInfo(_THIS, SDL_SysWMinfo * info);
#endif /* __SDL_PH_WM_H__ */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 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
*/
#include "SDL_config.h"
#ifndef __SDL_PH_YUV_H__
#define __SDL_PH_YUV_H__
/* This is the photon implementation of YUV video overlays */
#include "SDL_video.h"
#include "SDL_ph_video.h"
struct private_yuvhwdata
{
FRAMEDATA *CurrentFrameData;
FRAMEDATA *FrameData0;
FRAMEDATA *FrameData1;
PgScalerProps_t props;
PgScalerCaps_t caps;
PgVideoChannel_t *channel;
PhArea_t CurrentViewPort;
PhPoint_t CurrentWindowPos;
long format;
int scaler_on;
int current;
long YStride;
long VStride;
long UStride;
int ischromakey;
long chromakey;
int forcedredraw;
unsigned long State;
long flags;
int locked;
};
extern SDL_Overlay *ph_CreateYUVOverlay(_THIS, int width, int height,
Uint32 format, SDL_Surface * display);
extern int ph_LockYUVOverlay(_THIS, SDL_Overlay * overlay);
extern void ph_UnlockYUVOverlay(_THIS, SDL_Overlay * overlay);
extern int ph_DisplayYUVOverlay(_THIS, SDL_Overlay * overlay, SDL_Rect * src,
SDL_Rect * dst);
extern void ph_FreeYUVOverlay(_THIS, SDL_Overlay * overlay);
#endif /* __SDL_PH_YUV_H__ */
/* vi: set ts=4 sw=4 expandtab: */
...@@ -19,20 +19,17 @@ ...@@ -19,20 +19,17 @@
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#include "SDL_config.h"
#ifndef __SDL_PH_EVENTS_H__
#define __SDL_PH_EVENTS_H__
#include "SDL_ph_video.h" #include "SDL_config.h"
#define PH_SDL_MAX_RECTS 256 #include "../SDL_sysvideo.h"
#define PH_EVENT_SAFETY_POOL 512
#define EVENT_SIZE (sizeof(PhEvent_t) + 1000 + PH_EVENT_SAFETY_POOL)
/* Functions to be exported */ VideoBootStrap qnxgf_bootstrap=
extern void ph_InitOSKeymap(_THIS); {
extern void ph_PumpEvents(_THIS); "QNXGF",
"QNX Graphics Framework",
NULL,
NULL
};
#endif /* __SDL_PH_EVENTS_H__ */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment