Commit ba4c542e authored by Sam Lantinga's avatar Sam Lantinga

Date: Wed, 4 Mar 2009 15:38:22 +0200

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

Here is another batch of patches.

1) Makefile.in - added SDL_opengles.h header as header to install.
2) configure.in - Added special define to detect Common Lite OpenGL ES
library in case if Common library is not installed. Added check for
clock_gettime in libc (in QNX it is in libc).
3) SDL_config.h.in - Added SDL_VIDEO_RENDER_OPENGL_ES and
SDL_VIDEO_OPENGL_ES declarations for configure script autodetection.
4) SDL_opengles.h - Added GL_API definition if it is not defined. Added
extension GL_OES_draw_texture because OpenGL ES Renderer uses it without
declaration. Added GL_OES_vertex_buffer_object extension, which is supported
under QNX OpenGL ES. Added GL_OES_single_precision extension.
5) To the test directory I've added building OpenGL ES test applications
through the autotools suite. Was support for iPhone IDE building only.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403553
parent 7c0777a9
......@@ -42,7 +42,7 @@ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-OS2.zip Watcom-Win32.zip WhatsNew Xcode
HDRS = SDL.h SDL_audio.h SDL_cdrom.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_pixels.h SDL_platform.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
HDRS = SDL.h SDL_audio.h SDL_cdrom.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
......
......@@ -1705,12 +1705,12 @@ CheckOpenGLESQNX()
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>
],[
],[
......@@ -1719,7 +1719,6 @@ CheckOpenGLESQNX()
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
......@@ -2295,6 +2294,12 @@ AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettime
if test x$have_clock_gettime = xyes; then
AC_DEFINE(HAVE_CLOCK_GETTIME)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
else
AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
if test x$have_clock_gettime = xyes; then
AC_DEFINE(HAVE_CLOCK_GETTIME)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
fi
fi
fi
}
......
......@@ -310,10 +310,12 @@
#undef SDL_VIDEO_RENDER_D3D
#undef SDL_VIDEO_RENDER_GDI
#undef SDL_VIDEO_RENDER_OGL
#undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_X11
/* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL
#undef SDL_VIDEO_OPENGL_ES
#undef SDL_VIDEO_OPENGL_BGL
#undef SDL_VIDEO_OPENGL_CGL
#undef SDL_VIDEO_OPENGL_GLX
......
......@@ -40,10 +40,6 @@ extern "C"
#include <OpenGLES/ES1/gl.h> /* Header File For The OpenGL ES Library */
#endif
#if defined(__QNXNTO__) && defined(SDL_VIDEO_OPENGL_ES)
#include <GLES/egl.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
......@@ -52,6 +48,9 @@ extern "C"
#define GL_APIENTRY
#endif
#ifndef GL_API
#define GL_API
#endif /* GL_API */
/*
** License Applicability. Except to the extent portions of this file are
......@@ -659,6 +658,29 @@ extern "C"
#define GL_COORD_REPLACE_OES 0x8862
#endif
/* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture
#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
#endif /* GL_OES_draw_texture */
/* GL_OES_vertex_buffer_object */
#ifndef GL_OES_vertex_buffer_object
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_WRITE_ONLY 0x88B9
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_BUFFER_ACCESS 0x88BB
#endif /* GL_OES_vertex_buffer_object */
/*************************************************************/
/* Available only in Common profile */
......@@ -945,6 +967,42 @@ extern "C"
#define GL_OES_point_sprite 1
#endif
/* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture
#define GL_OES_draw_texture 1
GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
#endif /* GL_OES_draw_texture */
/* GL_OES_single_precision */
#ifndef GL_OES_single_precision
#define GL_OES_single_precision 1
GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar);
GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]);
GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
#endif /* GL_OES_single_precision */
/* GL_OES_vertex_buffer_object */
#ifndef GL_OES_vertex_buffer_object
#define GL_OES_vertex_buffer_object 1
GL_API void APIENTRY glBindBufferOES(GLenum, GLuint);
GL_API void APIENTRY glDeleteBuffersOES(GLsizei, const GLuint *);
GL_API void APIENTRY glGenBuffersOES(GLsizei, GLuint *);
GL_API GLboolean APIENTRY glIsBufferOES(GLuint);
GL_API void APIENTRY glBufferDataOES(GLenum, GLsizeiptr, const GLvoid *, GLenum);
GL_API void APIENTRY glBufferSubDataOES(GLenum, GLintptr, GLsizeiptr, const GLvoid *);
GL_API void APIENTRY glGetBufferParameterivOES(GLenum, GLenum, GLint *);
#endif /* GL_OES_vertex_buffer_object */
#ifdef __cplusplus
}
#endif
......
......@@ -169,7 +169,7 @@ struct SDL_SysWMinfo
int window; /* The RISC OS display window */
};
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
#elif defined(SDL_VIDEO_DRIVER_PHOTON) || defined(SDL_VIDEO_DRIVER_QNXGF)
#include <sys/neutrino.h>
#include <Ph.h>
......@@ -180,7 +180,7 @@ struct SDL_SysWMmsg
int data;
};
/* The QNX custom window manager information structure */
/* The QNX Photon custom window manager information structure */
struct SDL_SysWMinfo
{
SDL_version version;
......
/*
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_sysvideo.h"
static SDL_bool photon_initialized=SDL_FALSE;
static int photon_available(void)
{
int status;
/* Check if Photon was initialized before */
if (photon_initialized==SDL_FALSE)
{
/* Initialize Photon widget library and open channel to Photon */
status=PtInit(NULL);
if (status==0)
{
photon_initialized=SDL_TRUE;
return 1;
}
else
{
photon_initialized=SDL_FALSE;
return 0;
}
}
return 1;
}
static void photon_destroy(SDL_VideoDevice* device)
{
}
static SDL_VideoDevice* photon_create(int devindex)
{
}
VideoBootStrap photon_bootstrap=
{
"photon",
"SDL Photon video driver",
photon_available,
photon_create
};
/* 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_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_ABGR1555:
{
return GF_FORMAT_PACK_ARGB1555;
}
break;
case SDL_PIXELFORMAT_RGB565:
{
return GF_FORMAT_PACK_RGB565;
}
break;
case SDL_PIXELFORMAT_RGB888:
{
return GF_FORMAT_BGR888;
}
break;
case SDL_PIXELFORMAT_BGRA8888:
{
return GF_FORMAT_BGRA8888;
}
break;
case SDL_PIXELFORMAT_ARGB8888:
{
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_ARGB1555:
{
return SDL_PIXELFORMAT_ABGR1555;
}
break;
case GF_FORMAT_PKBE_RGB565:
{
return SDL_PIXELFORMAT_RGB565;
}
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:
{
return SDL_PIXELFORMAT_RGB888;
}
break;
case GF_FORMAT_BGRA8888:
{
return SDL_PIXELFORMAT_BGRA8888;
}
break;
case GF_FORMAT_ARGB8888:
{
return SDL_PIXELFORMAT_ARGB8888;
}
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;
}
/*
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
*/
#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__ */
/*
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_pixels_c.h"
#include "../SDL_yuv_sw_c.h"
#include "SDL_video.h"
#include "SDL_gf_render.h"
static SDL_Renderer* GF_CreateRenderer(SDL_Window* window, Uint32 flags)
{
}
SDL_RenderDriver GF_RenderDriver=
{
GF_CreateRenderer,
{
"qnxgf",
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC |
SDL_RENDERER_ACCELERATED),
(SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
SDL_TEXTUREMODULATE_ALPHA),
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW),
13,
{
SDL_PIXELFORMAT_INDEX8,
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
}
};
/*
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
*/
#ifndef __SDL_GF_RENDER_H__
#define __SDL_GF_RENDER_H__
#include "../SDL_sysvideo.h"
#include <gf/gf.h>
#endif /* __SDL_GF_RENDER_H__ */
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
*/
#ifndef __SDL_QNXGF_H__
#define __SDL_QNXGF_H__
#include "../SDL_sysvideo.h"
#include <gf/gf.h>
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 */
} SDL_VideoData;
typedef struct SDL_DisplayData
{
gf_display_info_t display_info; /* GF display information */
gf_display_t display; /* GF display handle */
} SDL_DisplayData;
/****************************************************************************/
/* 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_setdisplaypalette(_THIS, SDL_Palette* palette);
int qnxgf_getdisplaypalette(_THIS, SDL_Palette* palette);
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__ */
......@@ -7,7 +7,7 @@ EXE = @EXE@
CFLAGS = @CFLAGS@
LIBS = @LIBS@
TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testresample$(EXE) testaudioinfo$(EXE) testmultiaudio$(EXE) testalpha$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcdrom$(EXE) testcursor$(EXE) testintersections$(EXE) testdraw2$(EXE) testdyngl$(EXE) testerror$(EXE) testfile$(EXE) testgamma$(EXE) testgl$(EXE) testgl2$(EXE) testhread$(EXE) testiconv$(EXE) testjoystick$(EXE) testkeys$(EXE) testlock$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testsem$(EXE) testsprite$(EXE) testsprite2$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm$(EXE) testwm2$(EXE) threadwin$(EXE) torturethread$(EXE) testloadso$(EXE) testhaptic$(EXE) testmmousetablet$(EXE)
TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testresample$(EXE) testaudioinfo$(EXE) testmultiaudio$(EXE) testalpha$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcdrom$(EXE) testcursor$(EXE) testintersections$(EXE) testdraw2$(EXE) testdyngl$(EXE) testdyngles$(EXE) testerror$(EXE) testfile$(EXE) testgamma$(EXE) testgl$(EXE) testgl2$(EXE) testgles$(EXE) testhread$(EXE) testiconv$(EXE) testjoystick$(EXE) testkeys$(EXE) testlock$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testsem$(EXE) testsprite$(EXE) testsprite2$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm$(EXE) testwm2$(EXE) threadwin$(EXE) torturethread$(EXE) testloadso$(EXE) testhaptic$(EXE) testmmousetablet$(EXE)
all: Makefile $(TARGETS)
......@@ -56,6 +56,9 @@ testdraw2$(EXE): $(srcdir)/testdraw2.c $(srcdir)/common.c
testdyngl$(EXE): $(srcdir)/testdyngl.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS)
testdyngles$(EXE): $(srcdir)/testdyngles.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS)
testerror$(EXE): $(srcdir)/testerror.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS)
......@@ -71,6 +74,9 @@ testgl$(EXE): $(srcdir)/testgl.c
testgl2$(EXE): $(srcdir)/testgl2.c $(srcdir)/common.c
$(CC) -o $@ $(srcdir)/testgl2.c $(srcdir)/common.c $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
testgles$(EXE): $(srcdir)/testgles.c $(srcdir)/common.c
$(CC) -o $@ $(srcdir)/testgles.c $(srcdir)/common.c $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
testhread$(EXE): $(srcdir)/testhread.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS)
......
......@@ -50,6 +50,11 @@ case "$host" in
SYS_GL_LIBS="-lOSMesa"
fi
;;
*-*-qnx*)
EXE=""
MATHLIB=""
SYS_GL_LIBS="-lGLES_CM"
;;
*)
EXE=""
MATHLIB="-lm"
......@@ -99,6 +104,30 @@ if test x$have_opengl = xyes; then
else
GLLIB=""
fi
dnl Check for OpenGL ES
AC_MSG_CHECKING(for OpenGL ES support)
have_opengles=no
AC_TRY_COMPILE([
#if defined (__QNXNTO__)
#include <GLES/gl.h>
#elif defined (__IPHONEOS__)
#include <OpenGLES/ES1/gl.h>
#else
#error "No OpenGL ES support"
#endif /* __QNXNTO__ */
],[
],[
have_opengles=yes
])
AC_MSG_RESULT($have_opengles)
if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
GLLIB="$XPATH $SYS_GL_LIBS"
else
GLLIB=""
fi
AC_SUBST(GLLIB)
dnl Finally create all the generated files
......
......@@ -129,7 +129,7 @@ main(int argc, char *argv[])
}
if (SDL_GL_LoadLibrary(gl_library) < 0) {
printf("Unable to dynamically open GL lib : %s\n", SDL_GetError());
printf("Unable to dynamically open GL ES lib : %s\n", SDL_GetError());
quit(1);
}
......@@ -139,7 +139,7 @@ main(int argc, char *argv[])
}
/* Set the window manager title bar */
SDL_WM_SetCaption("SDL Dynamic OpenGL Loading Test", "testdyngl");
SDL_WM_SetCaption("SDL Dynamic OpenGL ES Loading Test", "testdyngles");
init_glfuncs(&f);
......@@ -206,7 +206,7 @@ main(int argc, char *argv[])
int
main(int argc, char *argv[])
{
printf("No OpenGL support on this system\n");
printf("No OpenGL ES support on this system\n");
return 1;
}
......
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