Mercurial > sdl-ios-xcode
comparison src/video/SDL_video.c @ 3099:82e60908fab1
Date: Mon, 23 Mar 2009 09:17:24 +0200
From: "Mike Gorchak"
Subject: New QNX patches
Please apply patch qnx4.diff, which is attached. What has been done:
1)Added back OpenGL ES renderer for QNX target. Added few corrections to
OpenGL ES renderer to let it work under QNX. OpenGL ES renderer do not
support textures under QNX, so I think some additional work must be done.
2) Added GL_OES_query_matrix extension to SDL_opengles.h header file, which
required by OpenGL ES 1.1 specification.
3) Added attribute clearing at the entrance of function
SDL_GL_GetAttribure(). Added error checking into the function
SDL_GL_GetAttribure(), because some attributes can't be obtained in OpenGL
ES 1.0.
4) Porting testdyngles to OpenGL ES 1.0 (1.1 has glColor4ub() and
glColor4f() functions, but 1.0 has glColor4f() only).
5) Added error checking after obtaining attributes using
SDL_GL_GetAttribute() function to the testgl2 and testgles.
6) Small correction to testmultiaudio with printing errors.
7) Added software and accelerated OpenGL ES 1.0 support into the QNX GF
driver.
Please remove ./src/audio/nto directory - it will not be used anymore.
Please create ./src/audio/qsa directory and add content of the archive
qsa.tar.gz into this directory. I rewrote some sound code, added support for
multiple audio cards, enumeration, etc. Added initial support for capture.
As far as I can understand SDL 1.3 is not supporting audio capture right now
? Sam, Am I right ? Or audio capture must be supported through the
PlayDevice routine ?
And last, please put file SDL_gf_opengles.c to the ./src/video/qnxgf
directory. It is OpenGL ES 1.1 emulation layer for some functions, which are
not supported by OpenGL ES 1.0.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 24 Mar 2009 10:33:12 +0000 |
parents | cad1aefa2ed9 |
children | 7dc982143c06 |
comparison
equal
deleted
inserted
replaced
3098:5f372cef955d | 3099:82e60908fab1 |
---|---|
2709 int | 2709 int |
2710 SDL_GL_GetAttribute(SDL_GLattr attr, int *value) | 2710 SDL_GL_GetAttribute(SDL_GLattr attr, int *value) |
2711 { | 2711 { |
2712 #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES | 2712 #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES |
2713 void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); | 2713 void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); |
2714 GLenum (APIENTRY * glGetErrorFunc) (void); | |
2714 GLenum attrib = 0; | 2715 GLenum attrib = 0; |
2716 GLenum error = 0; | |
2715 | 2717 |
2716 glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); | 2718 glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); |
2717 if (!glGetIntegervFunc) { | 2719 if (!glGetIntegervFunc) { |
2718 return -1; | 2720 return -1; |
2719 } | 2721 } |
2722 | |
2723 glGetErrorFunc = SDL_GL_GetProcAddress("glGetError"); | |
2724 if (!glGetErrorFunc) { | |
2725 return -1; | |
2726 } | |
2727 | |
2728 /* Clear value in any case */ | |
2729 *value=0; | |
2730 | |
2720 switch (attr) { | 2731 switch (attr) { |
2721 case SDL_GL_RETAINED_BACKING: | 2732 case SDL_GL_RETAINED_BACKING: |
2722 *value = _this->gl_config.retained_backing; | 2733 *value = _this->gl_config.retained_backing; |
2723 return 0; | 2734 return 0; |
2724 case SDL_GL_RED_SIZE: | 2735 case SDL_GL_RED_SIZE: |
2736 case SDL_GL_DOUBLEBUFFER: | 2747 case SDL_GL_DOUBLEBUFFER: |
2737 #ifndef SDL_VIDEO_OPENGL_ES | 2748 #ifndef SDL_VIDEO_OPENGL_ES |
2738 attrib = GL_DOUBLEBUFFER; | 2749 attrib = GL_DOUBLEBUFFER; |
2739 break; | 2750 break; |
2740 #else | 2751 #else |
2741 /* | 2752 /* OpenGL ES 1.0 and above specifications have EGL_SINGLE_BUFFER */ |
2742 * I believe double buffering is the only option in OpenGL ES | 2753 /* parameter which switches double buffer to single buffer. OpenGL ES */ |
2743 * -- in any case, GL_DOUBLEBUFFER doesn't exist | 2754 /* SDL driver must set proper value after initialization */ |
2744 */ | 2755 *value = _this->gl_config.double_buffer; |
2745 *value = 1; | |
2746 return 0; | 2756 return 0; |
2747 #endif | 2757 #endif |
2748 case SDL_GL_DEPTH_SIZE: | 2758 case SDL_GL_DEPTH_SIZE: |
2749 attrib = GL_DEPTH_BITS; | 2759 attrib = GL_DEPTH_BITS; |
2750 break; | 2760 break; |
2822 SDL_SetError("Unknown OpenGL attribute"); | 2832 SDL_SetError("Unknown OpenGL attribute"); |
2823 return -1; | 2833 return -1; |
2824 } | 2834 } |
2825 | 2835 |
2826 glGetIntegervFunc(attrib, (GLint *) value); | 2836 glGetIntegervFunc(attrib, (GLint *) value); |
2837 error=glGetErrorFunc(); | |
2838 if (error!=GL_NO_ERROR) | |
2839 { | |
2840 switch (error) | |
2841 { | |
2842 case GL_INVALID_ENUM: | |
2843 { | |
2844 SDL_SetError("OpenGL error: GL_INVALID_ENUM"); | |
2845 } | |
2846 break; | |
2847 case GL_INVALID_VALUE: | |
2848 { | |
2849 SDL_SetError("OpenGL error: GL_INVALID_VALUE"); | |
2850 } | |
2851 break; | |
2852 default: | |
2853 { | |
2854 SDL_SetError("OpenGL error: %08X", error); | |
2855 } | |
2856 break; | |
2857 } | |
2858 return -1; | |
2859 } | |
2827 return 0; | 2860 return 0; |
2828 #else | 2861 #else |
2829 SDL_Unsupported(); | 2862 SDL_Unsupported(); |
2830 return -1; | 2863 return -1; |
2831 #endif /* SDL_VIDEO_OPENGL */ | 2864 #endif /* SDL_VIDEO_OPENGL */ |