comparison test/testdyngles.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 0b6f51c29267
children 7f684f249ec9
comparison
equal deleted inserted replaced
3098:5f372cef955d 3099:82e60908fab1
63 63
64 void (APIENTRY * glClearColor) (GLfloat, GLfloat, GLfloat, GLfloat); 64 void (APIENTRY * glClearColor) (GLfloat, GLfloat, GLfloat, GLfloat);
65 void (APIENTRY * glClear) (GLbitfield); 65 void (APIENTRY * glClear) (GLbitfield);
66 void (APIENTRY * glDisable) (GLenum); 66 void (APIENTRY * glDisable) (GLenum);
67 void (APIENTRY * glEnable) (GLenum); 67 void (APIENTRY * glEnable) (GLenum);
68 void (APIENTRY * glColor4ub) (GLubyte, GLubyte, GLubyte, GLubyte); 68 void (APIENTRY * glColor4f) (GLfloat, GLfloat, GLfloat, GLfloat);
69 void (APIENTRY * glPointSize) (GLfloat); 69 void (APIENTRY * glPointSize) (GLfloat);
70 void (APIENTRY * glHint) (GLenum, GLenum); 70 void (APIENTRY * glHint) (GLenum, GLenum);
71 void (APIENTRY * glBlendFunc) (GLenum, GLenum); 71 void (APIENTRY * glBlendFunc) (GLenum, GLenum);
72 void (APIENTRY * glMatrixMode) (GLenum); 72 void (APIENTRY * glMatrixMode) (GLenum);
73 void (APIENTRY * glLoadIdentity) (); 73 void (APIENTRY * glLoadIdentity) ();
87 f->glDrawArrays = get_funcaddr("glDrawArrays"); 87 f->glDrawArrays = get_funcaddr("glDrawArrays");
88 f->glClearColor = get_funcaddr("glClearColor"); 88 f->glClearColor = get_funcaddr("glClearColor");
89 f->glClear = get_funcaddr("glClear"); 89 f->glClear = get_funcaddr("glClear");
90 f->glDisable = get_funcaddr("glDisable"); 90 f->glDisable = get_funcaddr("glDisable");
91 f->glEnable = get_funcaddr("glEnable"); 91 f->glEnable = get_funcaddr("glEnable");
92 f->glColor4ub = get_funcaddr("glColor4ub"); 92 f->glColor4f = get_funcaddr("glColor4f");
93 f->glPointSize = get_funcaddr("glPointSize"); 93 f->glPointSize = get_funcaddr("glPointSize");
94 f->glHint = get_funcaddr("glHint"); 94 f->glHint = get_funcaddr("glHint");
95 f->glBlendFunc = get_funcaddr("glBlendFunc"); 95 f->glBlendFunc = get_funcaddr("glBlendFunc");
96 f->glMatrixMode = get_funcaddr("glMatrixMode"); 96 f->glMatrixMode = get_funcaddr("glMatrixMode");
97 f->glLoadIdentity = get_funcaddr("glLoadIdentity"); 97 f->glLoadIdentity = get_funcaddr("glLoadIdentity");
116 int video_w, video_h; 116 int video_w, video_h;
117 117
118 /* you may want to change these according to the platform */ 118 /* you may want to change these according to the platform */
119 video_w = 320; 119 video_w = 320;
120 video_h = 480; 120 video_h = 480;
121 #ifdef __QNXNTO__
122 video_h = 640;
123 video_w = 480;
124 #endif /* __QNXNTO__ */
121 125
122 if (argv[1]) { 126 if (argv[1]) {
123 gl_library = argv[1]; 127 gl_library = argv[1];
124 } 128 }
125 129
147 pixels[3 * i] = rand() % 250 - 125; 151 pixels[3 * i] = rand() % 250 - 125;
148 pixels[3 * i + 1] = rand() % 250 - 125; 152 pixels[3 * i + 1] = rand() % 250 - 125;
149 pixels[3 * i + 2] = rand() % 250 - 125; 153 pixels[3 * i + 2] = rand() % 250 - 125;
150 } 154 }
151 155
152 f.glViewport(0, 0, video_w, video_h); 156 #ifdef __QNXNTO__
157 f.glViewport(0, 0, video_h, video_w);
158 #else
159 f.glViewport(0, 0, video_w, video_h);
160 #endif /* __QNXNTO__ */
153 161
154 f.glMatrixMode(GL_PROJECTION); 162 f.glMatrixMode(GL_PROJECTION);
155 f.glLoadIdentity(); 163 f.glLoadIdentity();
156 f.glOrthof(-100, 100, -100, 100, -500, 500); 164 f.glOrthof(-100, 100, -100, 100, -500, 500);
157 165
178 f.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 186 f.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
179 187
180 f.glRotatef(2.0, 1.0, 1.0, 1.0); 188 f.glRotatef(2.0, 1.0, 1.0, 1.0);
181 f.glRotatef(1.0, 0.0, 1.0, 1.0); 189 f.glRotatef(1.0, 0.0, 1.0, 1.0);
182 190
183 f.glColor4ub(255, 255, 255, 255); 191 f.glColor4f(1.0, 1.0, 1.0, 1.0);
184 192
185 f.glEnableClientState(GL_VERTEX_ARRAY); 193 f.glEnableClientState(GL_VERTEX_ARRAY);
186 f.glVertexPointer(3, GL_FLOAT, 0, pixels); 194 f.glVertexPointer(3, GL_FLOAT, 0, pixels);
187 f.glDrawArrays(GL_POINTS, 0, NB_PIXELS); 195 f.glDrawArrays(GL_POINTS, 0, NB_PIXELS);
188 196
189 SDL_GL_SwapBuffers(); 197 SDL_GL_SwapBuffers();
190 198
191 while (SDL_PollEvent(&event)) { 199 while (SDL_PollEvent(&event)) {
200 if (event.type == SDL_QUIT)
201 done = 1;
192 if (event.type == SDL_KEYDOWN) 202 if (event.type == SDL_KEYDOWN)
193 done = 1; 203 done = 1;
194 } 204 }
195 205
196 SDL_Delay(20); 206 SDL_Delay(20);