annotate test/testdyngles.c @ 2429:2c55b72ba46e gsoc2008_iphone

testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Fri, 15 Aug 2008 00:52:52 +0000
parents
children
rev   line source
2429
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
1 /*
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
2 * Small SDL example to demonstrate dynamically loading
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
3 * OpenGL lib and functions
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
4 *
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
5 * (FYI it was supposed to look like snow in the wind or something...)
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
6 *
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
7 * Compile with :
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
8 * gcc testdyngl.c `sdl-config --libs --cflags` -o testdyngl -DHAVE_OPENGL
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
9 *
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
10 * You can specify a different OpenGL lib on the command line, i.e. :
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
11 * ./testdyngl /usr/X11R6/lib/libGL.so.1.2
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
12 * or
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
13 * ./testdyngl /usr/lib/libGL.so.1.0.4496
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
14 *
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
15 */
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
16
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
17 #include <stdio.h>
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
18 #include <stdlib.h>
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
19
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
20 #include "SDL.h"
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
21
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
22 #ifdef __IPHONEOS__
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23 #define HAVE_OPENGLES
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
24 #endif
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
25
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
26 #ifdef HAVE_OPENGLES
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
27
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
28 #include "SDL_opengles.h"
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
29
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
30 /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31 static void
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32 quit(int rc)
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33 {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34 SDL_Quit();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
35 exit(rc);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
36 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
37
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
38 void *
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39 get_funcaddr(const char *p)
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40 {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41 void *f = SDL_GL_GetProcAddress(p);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42 if (f) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43 return f;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
44 } else {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
45 printf("Unable to get function pointer for %s\n", p);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
46 quit(1);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
47 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
48 return NULL;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
49 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
50
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
51 typedef struct
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
52 {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
53 //void (APIENTRY * glBegin) (GLenum);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
54 //void (APIENTRY * glEnd) ();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
55 //void (APIENTRY * glVertex3f) (GLfloat, GLfloat, GLfloat);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
56
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
57 void (APIENTRY *glEnableClientState)(GLenum array);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
58 void (APIENTRY *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
59 void (APIENTRY *glDrawArrays)(GLenum mode, GLint first, GLsizei count);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
60
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
61
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
62 void (APIENTRY * glClearColor) (GLfloat, GLfloat, GLfloat, GLfloat);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
63 void (APIENTRY * glClear) (GLbitfield);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
64 void (APIENTRY * glDisable) (GLenum);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
65 void (APIENTRY * glEnable) (GLenum);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
66 void (APIENTRY * glColor4ub) (GLubyte, GLubyte, GLubyte, GLubyte);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
67 void (APIENTRY * glPointSize) (GLfloat);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
68 void (APIENTRY * glHint) (GLenum, GLenum);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
69 void (APIENTRY * glBlendFunc) (GLenum, GLenum);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
70 void (APIENTRY * glMatrixMode) (GLenum);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
71 void (APIENTRY * glLoadIdentity) ();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
72 void (APIENTRY * glOrthof) (GLfloat, GLfloat, GLfloat, GLfloat,
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
73 GLfloat, GLfloat);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
74 void (APIENTRY * glRotatef) (GLfloat, GLfloat, GLfloat, GLfloat);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
75 void (APIENTRY * glViewport) (GLint, GLint, GLsizei, GLsizei);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
76 void (APIENTRY * glFogf) (GLenum, GLfloat);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
77 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
78 glfuncs;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
79
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
80 void
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
81 init_glfuncs(glfuncs * f)
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
82 {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
83 f->glEnableClientState = get_funcaddr("glEnableClientState");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
84 f->glVertexPointer = get_funcaddr("glVertexPointer");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
85 f->glDrawArrays = get_funcaddr("glDrawArrays");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
86 f->glClearColor = get_funcaddr("glClearColor");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
87 f->glClear = get_funcaddr("glClear");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
88 f->glDisable = get_funcaddr("glDisable");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
89 f->glEnable = get_funcaddr("glEnable");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
90 f->glColor4ub = get_funcaddr("glColor4ub");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
91 f->glPointSize = get_funcaddr("glPointSize");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
92 f->glHint = get_funcaddr("glHint");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
93 f->glBlendFunc = get_funcaddr("glBlendFunc");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
94 f->glMatrixMode = get_funcaddr("glMatrixMode");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
95 f->glLoadIdentity = get_funcaddr("glLoadIdentity");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
96 f->glOrthof = get_funcaddr("glOrthof");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
97 f->glRotatef = get_funcaddr("glRotatef");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
98 f->glViewport = get_funcaddr("glViewport");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
99 f->glFogf = get_funcaddr("glFogf");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
100 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
101
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
102 #define NB_PIXELS 1000
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
103
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
104 int
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
105 main(int argc, char *argv[])
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
106 {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
107 glfuncs f;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
108 int i;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
109 SDL_Event event;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
110 int done = 0;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
111 GLfloat pixels[NB_PIXELS * 3];
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
112 const char *gl_library = NULL; /* Use the default GL library */
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
113
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
114 int video_w, video_h;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
115
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
116 /* you may want to change these according to the platform */
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
117 video_w = 320;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
118 video_h = 480;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
119
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
120 if (argv[1]) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
121 gl_library = argv[1];
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
122 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
123
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
124 if (SDL_Init(SDL_INIT_VIDEO) < 0) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
125 printf("Unable to init SDL : %s\n", SDL_GetError());
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
126 return (1);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
127 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
128
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
129 if (SDL_GL_LoadLibrary(gl_library) < 0) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
130 printf("Unable to dynamically open GL lib : %s\n", SDL_GetError());
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
131 quit(1);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
132 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
133
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
134 if (SDL_SetVideoMode(video_h, video_w, 0, SDL_OPENGL) == NULL) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
135 printf("Unable to open video mode : %s\n", SDL_GetError());
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
136 quit(1);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
137 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
138
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
139 /* Set the window manager title bar */
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
140 SDL_WM_SetCaption("SDL Dynamic OpenGL Loading Test", "testdyngl");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
141
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
142 init_glfuncs(&f);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
143
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
144 for (i = 0; i < NB_PIXELS; i++) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
145 pixels[3 * i] = rand() % 250 - 125;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
146 pixels[3 * i + 1] = rand() % 250 - 125;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
147 pixels[3 * i + 2] = rand() % 250 - 125;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
148 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
149
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
150 f.glViewport(0, 0, video_w, video_h);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
151
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
152 f.glMatrixMode(GL_PROJECTION);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
153 f.glLoadIdentity();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
154 f.glOrthof(-100, 100, -100, 100, -500, 500);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
155
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
156 f.glMatrixMode(GL_MODELVIEW);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
157 f.glLoadIdentity();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
158
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
159 f.glEnable(GL_DEPTH_TEST);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
160 f.glDisable(GL_TEXTURE_2D);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
161 f.glEnable(GL_BLEND);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
162 f.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
163
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
164 f.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
165 f.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
166
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
167 f.glEnable(GL_POINT_SMOOTH);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
168 f.glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
169 f.glPointSize(5.0f);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
170 f.glEnable(GL_FOG);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
171 f.glFogf(GL_FOG_START, -500);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
172 f.glFogf(GL_FOG_END, 500);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
173 f.glFogf(GL_FOG_DENSITY, 0.005);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
174
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
175 do {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
176 f.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
177
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
178 f.glRotatef(2.0, 1.0, 1.0, 1.0);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
179 f.glRotatef(1.0, 0.0, 1.0, 1.0);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
180
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
181 f.glColor4ub(255, 255, 255, 255);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
182
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
183 f.glEnableClientState(GL_VERTEX_ARRAY);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
184 f.glVertexPointer(3, GL_FLOAT, 0, pixels);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
185 f.glDrawArrays(GL_POINTS, 0, NB_PIXELS);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
186
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
187 SDL_GL_SwapBuffers();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
188
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
189 while (SDL_PollEvent(&event)) {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
190 if (event.type == SDL_KEYDOWN)
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
191 done = 1;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
192 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
193
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
194 SDL_Delay(20);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
195 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
196 while (!done);
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
197
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
198 SDL_Quit();
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
199 return 0;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
200 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
201
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
202 #else /* HAVE_OPENGLES */
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
203
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
204 int
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
205 main(int argc, char *argv[])
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
206 {
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
207 printf("No OpenGL support on this system\n");
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
208 return 1;
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
209 }
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
210
2c55b72ba46e testdyngles is exactly what it sounds like -- a version of testdyngl that uses OpenGL ES calls instead of OpenGL. Was necessary to create because glOrtho is called glOrthof in OpenGL ES, and OpenGL ES doesn't have glBegin() type semantics for specifying geometry.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
211 #endif /* HAVE_OPENGLES */