comparison src/video/SDL_renderer_gles.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 0faae272a372
children 6c98826d88b0
comparison
equal deleted inserted replaced
3098:5f372cef955d 3099:82e60908fab1
27 #include "SDL_opengles.h" 27 #include "SDL_opengles.h"
28 #include "SDL_sysvideo.h" 28 #include "SDL_sysvideo.h"
29 #include "SDL_pixels_c.h" 29 #include "SDL_pixels_c.h"
30 #include "SDL_rect_c.h" 30 #include "SDL_rect_c.h"
31 #include "SDL_yuv_sw_c.h" 31 #include "SDL_yuv_sw_c.h"
32
33 #ifdef __QNXNTO__
34
35 /* Empty function stub to get OpenGL ES 1.0 support without */
36 /* OpenGL ES extension GL_OES_draw_texture_supported */
37 GL_API void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
38 {
39 return;
40 }
41
42 #endif /* __QNXNTO__ */
32 43
33 /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ 44 /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
34 45
35 static const float inv255f = 1.0f / 255.0f; 46 static const float inv255f = 1.0f / 255.0f;
36 47
347 GLES_TextureData *data; 358 GLES_TextureData *data;
348 GLint internalFormat; 359 GLint internalFormat;
349 GLenum format, type; 360 GLenum format, type;
350 int texture_w, texture_h; 361 int texture_w, texture_h;
351 GLenum result; 362 GLenum result;
363
352 switch (texture->format) { 364 switch (texture->format) {
353 case SDL_PIXELFORMAT_INDEX1LSB: 365 case SDL_PIXELFORMAT_INDEX1LSB:
354 case SDL_PIXELFORMAT_INDEX1MSB: 366 case SDL_PIXELFORMAT_INDEX1MSB:
355 case SDL_PIXELFORMAT_INDEX8: 367 case SDL_PIXELFORMAT_INDEX8:
356 case SDL_PIXELFORMAT_RGB332: 368 case SDL_PIXELFORMAT_RGB332:
477 489
478 static void 490 static void
479 SetupTextureUpdate(GLES_RenderData * renderdata, SDL_Texture * texture, 491 SetupTextureUpdate(GLES_RenderData * renderdata, SDL_Texture * texture,
480 int pitch) 492 int pitch)
481 { 493 {
482
483
484 GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; 494 GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
485 renderdata->glBindTexture(data->type, data->texture); 495 renderdata->glBindTexture(data->type, data->texture);
486 renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 496 renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
487 } 497 }
488 498
886 SDL_free(data); 896 SDL_free(data);
887 } 897 }
888 SDL_free(renderer); 898 SDL_free(renderer);
889 } 899 }
890 900
891 #endif /* SDL_VIDEO_RENDER_OGL */ 901 #endif /* SDL_VIDEO_RENDER_OGL_ES */
892 902
893 /* vi: set ts=4 sw=4 expandtab: */ 903 /* vi: set ts=4 sw=4 expandtab: */