annotate src/video/glesrenderer/SDL_renderer_gles.c @ 2359:b70b96e615d2 gsoc2008_iphone

These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver. There are a few differences between OpenGL and OpenGL ES that present difficulties for this driver: - OpenGL ES does NOT support many pixel formats (for example, no GL_BGR). Also, when using texture functions format and internalFormat must be the same -- this means 32 bit packed formats like SDL_PIXELFORMAT_BGR888 cannot be automatically converted to GL_RGB (which is 24bpp). - OpenGL ES doesn't have GL_PACK_ROW_LENGTH, which means data must be reformatted before uploading changes to dirty rects. This change has been added. - OpenGL ES doesn't support paletted textures, though there is an extension. I'm looking into this. Some other notable differences: - OpenGL ES has an extension called GL_OES_draw_texture which allows for quicker 2D sprite-type drawing. I use this in GL_RenderCopy when it is available. The iPhone supports the extension, but the iPhone Simulator does not (presently). - No glBegin() / glEnd() and no GL_QUADS! I'm using glDrawArrays with GL_TRIANGLE_STRIP instead!
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Thu, 17 Jul 2008 23:31:42 +0000
parents
children aad0c5ccf6bb
rev   line source
2359
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
1 /*
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
4
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
9
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
13 Lesser General Public License for more details.
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
14
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
18
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
19 Sam Lantinga
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
20 slouken@libsdl.org
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
21 */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
22 #include "SDL_config.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
24 #if SDL_VIDEO_RENDER_OGL_ES
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
25
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
26 #include "SDL_video.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
27 #include "SDL_opengles.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
28 #include "SDL_sysvideo.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
29 #include "SDL_pixels_c.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
30 #include "SDL_rect_c.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31 #include "SDL_yuv_sw_c.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33 /* OpenGL ES 1.1 renderer implementation */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
35 static const float inv255f = 1.0f / 255.0f;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
36
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
37 static SDL_Renderer *GL_CreateRenderer(SDL_Window * window, Uint32 flags);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
38 static int GL_ActivateRenderer(SDL_Renderer * renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39 static int GL_DisplayModeChanged(SDL_Renderer * renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40 static int GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41 static int GL_QueryTexturePixels(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42 SDL_Texture * texture, void **pixels,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43 int *pitch);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
44 static int GL_SetTexturePalette(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
45 SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
46 const SDL_Color * colors, int firstcolor,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
47 int ncolors);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
48 static int GL_GetTexturePalette(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
49 SDL_Texture * texture, SDL_Color * colors,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
50 int firstcolor, int ncolors);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
51 static int GL_SetTextureColorMod(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
52 SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
53 static int GL_SetTextureAlphaMod(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
54 SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
55 static int GL_SetTextureBlendMode(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
56 SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
57 static int GL_SetTextureScaleMode(SDL_Renderer * renderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
58 SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
59 static int GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
60 const SDL_Rect * rect, const void *pixels,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
61 int pitch);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
62 static int GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
63 const SDL_Rect * rect, int markDirty, void **pixels,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
64 int *pitch);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
65 static void GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
66 static void GL_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
67 int numrects, const SDL_Rect * rects);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
68 static int GL_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
69 Uint8 a, const SDL_Rect * rect);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
70 static int GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
71 const SDL_Rect * srcrect, const SDL_Rect * dstrect);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
72 static void GL_RenderPresent(SDL_Renderer * renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
73 static void GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
74 static void GL_DestroyRenderer(SDL_Renderer * renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
75
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
76
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
77 SDL_RenderDriver GL_ES_RenderDriver = {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
78 GL_CreateRenderer,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
79 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
80 "opengl_es",
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
81 (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD |
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
82 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
83 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
84 SDL_TEXTUREMODULATE_ALPHA),
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
85 (SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
86 SDL_TEXTUREBLENDMODE_BLEND | SDL_TEXTUREBLENDMODE_ADD |
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
87 SDL_TEXTUREBLENDMODE_MOD),
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
88 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
89 SDL_TEXTURESCALEMODE_SLOW),
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
90 #ifdef GL_IMG_texture_format_BGRA8888
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
91 3,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
92 #else
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
93 2,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
94 #endif
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
95 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
96 #ifdef GL_IMG_texture_format_BGRA8888
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
97 SDL_PIXELFORMAT_ARGB8888,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
98 #endif
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
99 SDL_PIXELFORMAT_RGB24,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
100 SDL_PIXELFORMAT_ABGR8888,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
101 },
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
102 0,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
103 0}
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
104 };
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
105
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
106 typedef struct
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
107 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
108 SDL_GLContext context;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
109 SDL_bool updateSize;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
110 int blendMode;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
111 int scaleMode;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
112
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
113 #ifndef APIENTRY
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
114 #define APIENTRY
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
115 #endif
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
116
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
117 SDL_bool useDrawTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
118 SDL_bool GL_OES_draw_texture_supported;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
119
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
120 /* OpenGL ES functions */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
121 #define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
122 #include "SDL_glesfuncs.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
123 #undef SDL_PROC
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
124
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
125 } GL_RenderData;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
126
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
127 typedef struct
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
128 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
129 GLuint texture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
130 GLenum type;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
131 GLfloat texw;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
132 GLfloat texh;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
133 GLenum format;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
134 GLenum formattype;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
135 void *pixels;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
136 int pitch;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
137 SDL_DirtyRectList dirty;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
138 } GL_TextureData;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
139
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
140 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
141 GL_SetError(const char *prefix, GLenum result)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
142 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
143 const char *error;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
144
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
145 switch (result) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
146 case GL_NO_ERROR:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
147 error = "GL_NO_ERROR";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
148 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
149 case GL_INVALID_ENUM:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
150 error = "GL_INVALID_ENUM";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
151 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
152 case GL_INVALID_VALUE:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
153 error = "GL_INVALID_VALUE";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
154 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
155 case GL_INVALID_OPERATION:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
156 error = "GL_INVALID_OPERATION";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
157 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
158 case GL_STACK_OVERFLOW:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
159 error = "GL_STACK_OVERFLOW";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
160 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
161 case GL_STACK_UNDERFLOW:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
162 error = "GL_STACK_UNDERFLOW";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
163 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
164 case GL_OUT_OF_MEMORY:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
165 error = "GL_OUT_OF_MEMORY";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
166 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
167 default:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
168 error = "UNKNOWN";
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
169 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
170 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
171 SDL_SetError("%s: %s", prefix, error);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
172 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
173
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
174 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
175 GL_LoadFunctions(GL_RenderData * data)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
176 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
177
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
178 #define SDL_PROC(ret,func,params) \
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
179 data->func = func;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
180 #include "SDL_glesfuncs.h"
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
181 #undef SDL_PROC
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
182
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
183 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
184 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
185
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
186 void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
187 GL_AddRenderDriver(_THIS)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
188 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
189 if (_this->GL_CreateContext) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
190 SDL_AddRenderDriver(0, &GL_ES_RenderDriver);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
191 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
192 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
193
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
194 SDL_Renderer *
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
195 GL_CreateRenderer(SDL_Window * window, Uint32 flags)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
196 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
197
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
198 printf("gl(es) create renderer ...\n");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
199
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
200 SDL_Renderer *renderer;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
201 GL_RenderData *data;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
202 GLint value;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
203 int doublebuffer;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
204
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
205 if (!(window->flags & SDL_WINDOW_OPENGL)) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
206 if (SDL_RecreateWindow(window, window->flags | SDL_WINDOW_OPENGL) < 0) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
207 return NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
208 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
209 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
210
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
211 renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
212 if (!renderer) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
213 SDL_OutOfMemory();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
214 return NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
215 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
216
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
217 data = (GL_RenderData *) SDL_calloc(1, sizeof(*data));
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
218 if (!data) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
219 GL_DestroyRenderer(renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
220 SDL_OutOfMemory();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
221 return NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
222 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
223
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
224 renderer->ActivateRenderer = GL_ActivateRenderer;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
225 renderer->DisplayModeChanged = GL_DisplayModeChanged;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
226 renderer->CreateTexture = GL_CreateTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
227 renderer->QueryTexturePixels = GL_QueryTexturePixels;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
228 renderer->SetTexturePalette = GL_SetTexturePalette;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
229 renderer->GetTexturePalette = GL_GetTexturePalette;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
230 renderer->SetTextureColorMod = GL_SetTextureColorMod;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
231 renderer->SetTextureAlphaMod = GL_SetTextureAlphaMod;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
232 renderer->SetTextureBlendMode = GL_SetTextureBlendMode;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
233 renderer->SetTextureScaleMode = GL_SetTextureScaleMode;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
234 renderer->UpdateTexture = GL_UpdateTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
235 renderer->LockTexture = GL_LockTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
236 renderer->UnlockTexture = GL_UnlockTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
237 renderer->DirtyTexture = GL_DirtyTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
238 renderer->RenderFill = GL_RenderFill;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
239 renderer->RenderCopy = GL_RenderCopy;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
240 renderer->RenderPresent = GL_RenderPresent;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
241 renderer->DestroyTexture = GL_DestroyTexture;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
242 renderer->DestroyRenderer = GL_DestroyRenderer;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
243 renderer->info = GL_ES_RenderDriver.info;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
244 renderer->window = window->id;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
245 renderer->driverdata = data;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
246
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
247
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
248 renderer->info.flags = (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
249
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
250 if (GL_LoadFunctions(data) < 0) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
251 GL_DestroyRenderer(renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
252 return NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
253 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
254
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
255 data->context = SDL_GL_CreateContext(window->id);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
256 if (!data->context) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
257 GL_DestroyRenderer(renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
258 return NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
259 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
260 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
261 GL_DestroyRenderer(renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
262 return NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
263 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
264
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
265 if (flags & SDL_RENDERER_PRESENTVSYNC) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
266 SDL_GL_SetSwapInterval(1);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
267 } else {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
268 SDL_GL_SetSwapInterval(0);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
269 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
270 if (SDL_GL_GetSwapInterval() > 0) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
271 renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
272 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
273
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
274 if (SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &doublebuffer) == 0) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
275 if (!doublebuffer) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
276 renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
277 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
278 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
279
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
280 if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
281 printf("using draw texture\n");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
282 data->GL_OES_draw_texture_supported = SDL_TRUE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
283 data->useDrawTexture = SDL_TRUE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
284 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
285 else {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
286 printf("not using draw texture\n");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
287 data->GL_OES_draw_texture_supported = SDL_FALSE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
288 data->useDrawTexture = SDL_FALSE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
289 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
290
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
291 data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
292 renderer->info.max_texture_width = value;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
293 data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
294 renderer->info.max_texture_height = value;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
295
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
296 /* Set up parameters for rendering */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
297 data->blendMode = -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
298 data->scaleMode = -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
299 data->glDisable(GL_DEPTH_TEST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
300 data->glDisable(GL_CULL_FACE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
301 data->glEnable(GL_TEXTURE_2D);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
302 data->updateSize = SDL_TRUE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
303
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
304 return renderer;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
305 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
306
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
307 static int GL_ActivateRenderer(SDL_Renderer * renderer)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
308 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
309
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
310 GL_RenderData *data = (GL_RenderData *)renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
311 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
312
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
313 if (data->context == NULL) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
314 printf("Context is null, dude\n");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
315 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
316
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
317 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
318 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
319 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
320 if (data->updateSize) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
321 data->glMatrixMode(GL_PROJECTION);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
322 data->glLoadIdentity();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
323 data->glMatrixMode(GL_MODELVIEW);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
324 data->glLoadIdentity();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
325 data->glViewport(0, 0, window->w, window->h);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
326 data->glOrthof(0.0, (GLfloat)window->w, (GLfloat)window->h, 0.0,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
327 0.0, 1.0);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
328 data->updateSize = SDL_FALSE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
329 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
330 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
331 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
332
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
333 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
334 GL_DisplayModeChanged(SDL_Renderer * renderer)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
335 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
336 GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
337
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
338 data->updateSize = SDL_TRUE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
339 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
340 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
341
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
342 static __inline__ int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
343 power_of_2(int input)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
344 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
345 int value = 1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
346
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
347 while (value < input) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
348 value <<= 1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
349 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
350 return value;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
351 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
352
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
353 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
354 GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
355 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
356 GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
357 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
358 GL_TextureData *data;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
359 GLint internalFormat;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
360 GLenum format, type;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
361 int texture_w, texture_h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
362 GLenum result;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
363 switch (texture->format) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
364 case SDL_PIXELFORMAT_INDEX1LSB:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
365 case SDL_PIXELFORMAT_INDEX1MSB:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
366 case SDL_PIXELFORMAT_INDEX8:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
367 case SDL_PIXELFORMAT_RGB332:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
368 case SDL_PIXELFORMAT_RGB444:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
369 case SDL_PIXELFORMAT_RGB555:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
370 case SDL_PIXELFORMAT_ARGB4444:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
371 case SDL_PIXELFORMAT_ARGB1555:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
372 case SDL_PIXELFORMAT_BGR24:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
373 case SDL_PIXELFORMAT_BGR888: /* can't convert 32 bit format to 24 */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
374 case SDL_PIXELFORMAT_RGB888:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
375 case SDL_PIXELFORMAT_RGBA8888:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
376 case SDL_PIXELFORMAT_ARGB2101010:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
377 SDL_SetError("Unsupported format");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
378 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
379 case SDL_PIXELFORMAT_ARGB8888:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
380 #ifdef GL_IMG_texture_format_BGRA8888
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
381 internalFormat = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
382 format = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
383 type = GL_UNSIGNED_BYTE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
384 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
385 #else
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
386 SDL_SetError("Unsupported format");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
387 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
388 #endif
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
389 case SDL_PIXELFORMAT_RGB24:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
390 internalFormat = GL_RGB;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
391 format = GL_RGB;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
392 type = GL_UNSIGNED_BYTE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
393 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
394 case SDL_PIXELFORMAT_ABGR8888:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
395 internalFormat = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
396 format = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
397 type = GL_UNSIGNED_BYTE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
398 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
399 /*
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
400 These formats would be supported if SDL had the necessary pixel formats
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
401 case SDL_PIXELFORMAT_BGR565:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
402 internalFormat = GL_RGB;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
403 format = GL_RGB;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
404 type = GL_UNSIGNED_SHORT_5_6_5;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
405 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
406 case SDL_PIXELFORMAT_ABGR5551:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
407 internalFormat = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
408 format = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
409 type = GL_UNSIGNED_SHORT_5_5_5_1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
410 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
411 case SDL_PIXELFORMAT_ABGR4444:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
412 internalFormat = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
413 format = GL_RGBA;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
414 type = GL_UNSIGNED_SHORT_4_4_4_4;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
415 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
416 */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
417 default:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
418 SDL_SetError("Unsupported texture format");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
419 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
420 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
421 data = (GL_TextureData *) SDL_calloc(1, sizeof(*data));
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
422 if (!data) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
423 SDL_OutOfMemory();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
424 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
425 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
426
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
427 if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
428 data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
429 data->pixels = SDL_malloc(texture->h * data->pitch);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
430 if (!data->pixels) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
431 SDL_OutOfMemory();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
432 SDL_free(data);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
433 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
434 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
435 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
436
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
437 texture->driverdata = data;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
438
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
439 renderdata->glGetError();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
440 renderdata->glGenTextures(1, &data->texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
441
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
442 data->type = GL_TEXTURE_2D;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
443 texture_w = power_of_2(texture->w);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
444 texture_h = power_of_2(texture->h);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
445 data->texw = (GLfloat) texture->w / texture_w;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
446 data->texh = (GLfloat) texture->h / texture_h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
447
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
448 data->format = format;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
449 data->formattype = type;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
450 renderdata->glBindTexture(data->type, data->texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
451 renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
452 GL_NEAREST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
453 renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
454 GL_NEAREST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
455 renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
456 GL_CLAMP_TO_EDGE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
457 renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
458 GL_CLAMP_TO_EDGE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
459
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
460 renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
461 texture_h, 0, format, type, NULL);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
462
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
463 result = renderdata->glGetError();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
464 if (result != GL_NO_ERROR) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
465 GL_SetError("glTexImage2D()", result);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
466 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
467 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
468 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
469 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
470
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
471 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
472 GL_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
473 void **pixels, int *pitch)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
474 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
475 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
476
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
477 *pixels = data->pixels;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
478 *pitch = data->pitch;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
479 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
480 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
481
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
482 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
483 GL_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
484 const SDL_Color * colors, int firstcolor, int ncolors)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
485 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
486 SDL_SetError("OpenGL ES does not support paletted textures");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
487 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
488 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
489
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
490 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
491 GL_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
492 SDL_Color * colors, int firstcolor, int ncolors)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
493 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
494 SDL_SetError("OpenGL ES does not support paletted textures");
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
495 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
496 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
497
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
498 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
499 SetupTextureUpdate(GL_RenderData * renderdata, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
500 int pitch)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
501 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
502
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
503
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
504 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
505 renderdata->glBindTexture(data->type, data->texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
506 renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
507 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
508
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
509 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
510 GL_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
511 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
512 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
513 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
514
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
515 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
516 GL_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
517 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
518 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
519 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
520
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
521 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
522 GL_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
523 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
524 switch (texture->blendMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
525 case SDL_TEXTUREBLENDMODE_NONE:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
526 case SDL_TEXTUREBLENDMODE_MASK:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
527 case SDL_TEXTUREBLENDMODE_BLEND:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
528 case SDL_TEXTUREBLENDMODE_ADD:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
529 case SDL_TEXTUREBLENDMODE_MOD:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
530 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
531 default:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
532 SDL_Unsupported();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
533 texture->blendMode = SDL_TEXTUREBLENDMODE_NONE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
534 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
535 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
536 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
537
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
538 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
539 GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
540 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
541 switch (texture->scaleMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
542 case SDL_TEXTURESCALEMODE_NONE:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
543 case SDL_TEXTURESCALEMODE_FAST:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
544 case SDL_TEXTURESCALEMODE_SLOW:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
545 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
546 case SDL_TEXTURESCALEMODE_BEST:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
547 SDL_Unsupported();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
548 texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
549 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
550 default:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
551 SDL_Unsupported();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
552 texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
553 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
554 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
555 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
556
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
557 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
558 GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
559 const SDL_Rect * rect, const void *pixels, int pitch)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
560 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
561 GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
562 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
563 GLenum result;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
564
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
565 SetupTextureUpdate(renderdata, texture, pitch);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
566 renderdata->glGetError();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
567 renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
568 rect->h, data->format, data->formattype,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
569 pixels);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
570 result = renderdata->glGetError();
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
571 if (result != GL_NO_ERROR) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
572 GL_SetError("glTexSubImage2D()", result);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
573 return -1;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
574 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
575 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
576 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
577
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
578 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
579 GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
580 const SDL_Rect * rect, int markDirty, void **pixels,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
581 int *pitch)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
582 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
583 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
584
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
585 if (markDirty) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
586 SDL_AddDirtyRect(&data->dirty, rect);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
587 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
588
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
589 *pixels =
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
590 (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
591 rect->x * SDL_BYTESPERPIXEL(texture->format));
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
592 *pitch = data->pitch;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
593 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
594 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
595
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
596 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
597 GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
598 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
599 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
600
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
601 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
602 GL_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture, int numrects,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
603 const SDL_Rect * rects)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
604 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
605 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
606 int i;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
607
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
608 for (i = 0; i < numrects; ++i) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
609 SDL_AddDirtyRect(&data->dirty, &rects[i]);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
610 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
611 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
612
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
613 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
614 GL_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
615 const SDL_Rect * rect)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
616 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
617
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
618 GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
619 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
620
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
621 /* set proper drawing color */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
622 GLfloat oldClearColor[4];
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
623
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
624 data->glGetFloatv(GL_COLOR_CLEAR_VALUE, oldClearColor);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
625
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
626 data->glClearColor((GLclampf) r * inv255f, (GLclampf) g * inv255f,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
627 (GLclampf) b * inv255f, (GLclampf) a * inv255f);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
628
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
629 data->glScissor(rect->x, window->h - rect->y - rect->h, rect->w, rect->h);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
630 data->glEnable(GL_SCISSOR_TEST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
631 data->glClear(GL_COLOR_BUFFER_BIT);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
632 data->glDisable(GL_SCISSOR_TEST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
633
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
634 /* reset clear color */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
635 data->glClearColor(oldClearColor[0], oldClearColor[1], oldClearColor[2], oldClearColor[2]);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
636
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
637 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
638 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
639
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
640 static int
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
641 GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
642 const SDL_Rect * srcrect, const SDL_Rect * dstrect)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
643 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
644
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
645 GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
646 GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
647 int minx, miny, maxx, maxy;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
648 GLfloat minu, maxu, minv, maxv;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
649 int i;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
650 void *temp_buffer; /* used for reformatting dirty rect pixels */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
651 void *temp_ptr;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
652
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
653 if (texturedata->dirty.list) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
654 SDL_DirtyRect *dirty;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
655 void *pixels;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
656 int bpp = SDL_BYTESPERPIXEL(texture->format);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
657 int pitch = texturedata->pitch;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
658
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
659 SetupTextureUpdate(data, texture, pitch);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
660
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
661 data->glBindTexture(texturedata->type, texturedata->texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
662 for (dirty = texturedata->dirty.list; dirty; dirty = dirty->next) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
663 SDL_Rect *rect = &dirty->rect;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
664 pixels = (void *) ((Uint8 *) texturedata->pixels + rect->y * pitch + rect->x * bpp);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
665 /* There is no GL_UNPACK_ROW_LENGTH in OpenGLES
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
666 we must do this reformatting ourselves(!)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
667
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
668 maybe it'd be a good idea to keep a temp buffer around
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
669 for this purpose rather than allocating it each time
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
670 */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
671 temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
672 temp_ptr = temp_buffer;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
673 for (i=0; i<rect->h; i++) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
674 SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
675 temp_ptr += rect->w * bpp;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
676 pixels += pitch;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
677 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
678
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
679 data->glTexSubImage2D(texturedata->type, 0, rect->x, rect->y,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
680 rect->w, rect->h, texturedata->format,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
681 texturedata->formattype, temp_buffer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
682
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
683 SDL_free(temp_buffer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
684
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
685 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
686 SDL_ClearDirtyRects(&texturedata->dirty);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
687 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
688
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
689 data->glBindTexture(texturedata->type, texturedata->texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
690 data->glEnable(GL_TEXTURE_2D);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
691
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
692 if (texture->modMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
693 data->glColor4f((GLfloat) texture->r * inv255f,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
694 (GLfloat) texture->g * inv255f,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
695 (GLfloat) texture->b * inv255f,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
696 (GLfloat) texture->a * inv255f);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
697 } else {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
698 data->glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
699 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
700
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
701 //if (texture->blendMode != data->blendMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
702 switch (texture->blendMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
703 case SDL_TEXTUREBLENDMODE_NONE:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
704 data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
705 data->glDisable(GL_BLEND);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
706 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
707 case SDL_TEXTUREBLENDMODE_MASK:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
708 case SDL_TEXTUREBLENDMODE_BLEND:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
709 data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
710 data->glEnable(GL_BLEND);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
711 data->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
712 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
713 case SDL_TEXTUREBLENDMODE_ADD:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
714 data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
715 data->glEnable(GL_BLEND);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
716 data->glBlendFunc(GL_SRC_ALPHA, GL_ONE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
717 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
718 case SDL_TEXTUREBLENDMODE_MOD:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
719 data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
720 data->glEnable(GL_BLEND);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
721 data->glBlendFunc(GL_ZERO, GL_SRC_COLOR);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
722 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
723 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
724 data->blendMode = texture->blendMode;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
725 // }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
726
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
727 // if (texture->scaleMode != data->scaleMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
728 switch (texture->scaleMode) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
729 case SDL_TEXTURESCALEMODE_NONE:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
730 case SDL_TEXTURESCALEMODE_FAST:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
731 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
732 GL_NEAREST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
733 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
734 GL_NEAREST);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
735 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
736 case SDL_TEXTURESCALEMODE_SLOW:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
737 case SDL_TEXTURESCALEMODE_BEST:
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
738 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
739 GL_LINEAR);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
740 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
741 GL_LINEAR);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
742 break;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
743 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
744 data->scaleMode = texture->scaleMode;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
745 //}
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
746
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
747 if (data->GL_OES_draw_texture_supported && data->useDrawTexture) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
748 /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
749 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
750 GLint cropRect[4];
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
751 cropRect[0] = srcrect->x;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
752 cropRect[1] = srcrect->y + srcrect->h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
753 cropRect[2] = srcrect->w;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
754 cropRect[3] = -srcrect->h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
755 data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, cropRect);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
756 data->glDrawTexiOES(dstrect->x, window->h - dstrect->y - dstrect->h, 0, dstrect->w, dstrect->h);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
757 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
758 else {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
759
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
760 minx = dstrect->x;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
761 miny = dstrect->y;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
762 maxx = dstrect->x + dstrect->w;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
763 maxy = dstrect->y + dstrect->h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
764
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
765 minu = (GLfloat) srcrect->x / texture->w;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
766 minu *= texturedata->texw;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
767 maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
768 maxu *= texturedata->texw;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
769 minv = (GLfloat) srcrect->y / texture->h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
770 minv *= texturedata->texh;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
771 maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
772 maxv *= texturedata->texh;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
773
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
774 GLshort vertices[8];
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
775 GLfloat texCoords[8];
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
776
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
777 vertices[0] = minx; vertices[1] = miny;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
778 vertices[2] = maxx; vertices[3] = miny;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
779 vertices[4] = minx; vertices[5] = maxy;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
780 vertices[6] = maxx; vertices[7] = maxy;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
781
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
782 texCoords[0] = minu; texCoords[1] = minv;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
783 texCoords[2] = maxu; texCoords[3] = minv;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
784 texCoords[4] = minu; texCoords[5] = maxv;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
785 texCoords[6] = maxu; texCoords[7] = maxv;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
786
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
787 data->glVertexPointer(2, GL_SHORT, 0, vertices);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
788 data->glEnableClientState(GL_VERTEX_ARRAY);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
789 data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
790 data->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
791 data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
792
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
793 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
794
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
795 return 0;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
796 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
797
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
798 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
799 GL_RenderPresent(SDL_Renderer * renderer)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
800 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
801 SDL_GL_SwapWindow(renderer->window);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
802 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
803
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
804 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
805 GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
806 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
807 GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
808 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
809
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
810 if (!data) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
811 return;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
812 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
813 if (data->texture) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
814 glDeleteTextures(1, &data->texture);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
815 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
816 if (data->pixels) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
817 SDL_free(data->pixels);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
818 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
819 SDL_FreeDirtyRects(&data->dirty);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
820 SDL_free(data);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
821 texture->driverdata = NULL;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
822 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
823
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
824 static void
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
825 GL_DestroyRenderer(SDL_Renderer * renderer)
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
826 {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
827 GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
828
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
829 if (data) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
830 if (data->context) {
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
831 /* SDL_GL_MakeCurrent(0, NULL); *//* doesn't do anything */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
832 SDL_GL_DeleteContext(data->context);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
833 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
834 SDL_free(data);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
835 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
836 SDL_free(renderer);
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
837 }
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
838
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
839 #endif /* SDL_VIDEO_RENDER_OGL */
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
840
b70b96e615d2 These files are the OpenGL ES render driver. You should be able to use them on any platform that supports OpenGL ES -- not just iPhone. The driver is based off the OpenGL render driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
841 /* vi: set ts=4 sw=4 expandtab: */