author | Holmes Futrell <hfutrell@umail.ucsb.edu> |
Fri, 15 Aug 2008 00:44:07 +0000 | |
branch | gsoc2008_iphone |
changeset 2426 | aad0c5ccf6bb |
parent 2359 | b70b96e615d2 |
child 2456 | da4fd7cf8745 |
permissions | -rw-r--r-- |
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 |
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
|
282 |
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
|
283 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
285 |
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
|
286 |
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
|
287 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
290 |
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
|
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_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
|
293 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
/* 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
|
295 |
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
|
296 |
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
|
297 |
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
|
298 |
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
|
299 |
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
|
300 |
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
|
301 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
309 |
SDL_Window *window = SDL_GetWindowFromID(renderer->window); |
2426
aad0c5ccf6bb
Removed log messages
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2359
diff
changeset
|
310 |
|
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
|
311 |
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
|
312 |
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
|
313 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
315 |
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
|
316 |
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
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
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
|
322 |
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
|
323 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
325 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
328 |
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
|
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 |
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
|
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 |
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
|
333 |
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
|
334 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
337 |
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
|
338 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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 |
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
|
342 |
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
|
343 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
345 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
348 |
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
|
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 |
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
|
351 |
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
|
352 |
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
|
353 |
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
|
354 |
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
|
355 |
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
|
356 |
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
|
357 |
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
|
358 |
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
|
359 |
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
|
360 |
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
|
361 |
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
|
362 |
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
|
363 |
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
|
364 |
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
|
365 |
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
|
366 |
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
|
367 |
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
|
368 |
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
|
369 |
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
|
370 |
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
|
371 |
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
|
372 |
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
|
373 |
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
|
374 |
#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
|
375 |
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
|
376 |
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
|
377 |
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
|
378 |
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
|
379 |
#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
|
380 |
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
|
381 |
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
|
382 |
#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
|
383 |
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
|
384 |
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
|
385 |
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
|
386 |
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
|
387 |
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
|
388 |
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
|
389 |
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
|
390 |
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
|
391 |
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
|
392 |
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
|
393 |
/* |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
395 |
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
|
396 |
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
|
397 |
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
|
398 |
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
|
399 |
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
|
400 |
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
|
401 |
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
|
402 |
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
|
403 |
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
|
404 |
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
|
405 |
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
|
406 |
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
|
407 |
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
|
408 |
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
|
409 |
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
|
410 |
*/ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
412 |
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
|
413 |
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
|
414 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
416 |
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
|
417 |
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
|
418 |
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
|
419 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
422 |
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
|
423 |
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
|
424 |
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
|
425 |
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
|
426 |
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
|
427 |
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
|
428 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
432 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
434 |
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
|
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 |
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
|
437 |
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
|
438 |
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
|
439 |
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
|
440 |
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
|
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->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
|
443 |
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
|
444 |
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
|
445 |
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
|
446 |
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
|
447 |
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
|
448 |
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
|
449 |
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
|
450 |
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
|
451 |
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
|
452 |
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
|
453 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
455 |
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
|
456 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
458 |
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
|
459 |
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
|
460 |
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
|
461 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
463 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
466 |
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
|
467 |
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
|
468 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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 |
*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
|
472 |
*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
|
473 |
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
|
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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
477 |
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
|
478 |
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
|
479 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
481 |
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
|
482 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
485 |
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
|
486 |
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
|
487 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
489 |
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
|
490 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
493 |
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
|
494 |
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
|
495 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
499 |
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
|
500 |
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
|
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 |
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
|
504 |
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
|
505 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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_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
|
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_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
|
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 |
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
|
519 |
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
|
520 |
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
|
521 |
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
|
522 |
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
|
523 |
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
|
524 |
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
|
525 |
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
|
526 |
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
|
527 |
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
|
528 |
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
|
529 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
533 |
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
|
534 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
536 |
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
|
537 |
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
|
538 |
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
|
539 |
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
|
540 |
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
|
541 |
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
|
542 |
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
|
543 |
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
|
544 |
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
|
545 |
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
|
546 |
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
|
547 |
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
|
548 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
552 |
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
|
553 |
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
|
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 |
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
|
556 |
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
|
557 |
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
|
558 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
560 |
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
|
561 |
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
|
562 |
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
|
563 |
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
|
564 |
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
|
565 |
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
|
566 |
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
|
567 |
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
|
568 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
570 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
573 |
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
|
574 |
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
|
575 |
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
|
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 |
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
|
578 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
580 |
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
|
581 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
*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
|
584 |
(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
|
585 |
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
|
586 |
*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
|
587 |
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
|
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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
591 |
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
|
592 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
596 |
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
|
597 |
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
|
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 |
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
|
600 |
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
|
601 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
603 |
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
|
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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
608 |
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
|
609 |
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
|
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 |
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
|
613 |
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
|
614 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
/* 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
|
616 |
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
|
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 |
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
|
619 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
621 |
(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
|
622 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
624 |
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
|
625 |
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
|
626 |
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
|
627 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
/* 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
|
629 |
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
|
630 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
632 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
635 |
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
|
636 |
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
|
637 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
640 |
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
|
641 |
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
|
642 |
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
|
643 |
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
|
644 |
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
|
645 |
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
|
646 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
648 |
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
|
649 |
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
|
650 |
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
|
651 |
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
|
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 |
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
|
654 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
656 |
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
|
657 |
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
|
658 |
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
|
659 |
/* 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
|
660 |
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
|
661 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
663 |
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
|
664 |
*/ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
666 |
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
|
667 |
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
|
668 |
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
|
669 |
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
|
670 |
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
|
671 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
674 |
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
|
675 |
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
|
676 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
681 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
684 |
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
|
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 |
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
|
687 |
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
|
688 |
(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
|
689 |
(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
|
690 |
(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
|
691 |
} 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
|
692 |
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
|
693 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
//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
|
696 |
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
|
697 |
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
|
698 |
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
|
699 |
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
|
700 |
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
|
701 |
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
|
702 |
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
|
703 |
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
|
704 |
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
|
705 |
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
|
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_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
|
708 |
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
|
709 |
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
|
710 |
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
|
711 |
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
|
712 |
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
|
713 |
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
|
714 |
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
|
715 |
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
|
716 |
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
|
717 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
719 |
// } |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
// 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
|
722 |
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
|
723 |
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
|
724 |
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
|
725 |
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
|
726 |
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
|
727 |
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
|
728 |
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
|
729 |
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
|
730 |
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
|
731 |
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
|
732 |
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
|
733 |
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
|
734 |
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
|
735 |
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
|
736 |
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
|
737 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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->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
|
739 |
//} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
742 |
/* 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
|
743 |
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
|
744 |
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
|
745 |
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
|
746 |
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
|
747 |
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
|
748 |
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
|
749 |
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
|
750 |
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
|
751 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
753 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
755 |
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
|
756 |
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
|
757 |
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
|
758 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
760 |
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
|
761 |
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
|
762 |
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
|
763 |
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
|
764 |
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
|
765 |
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
|
766 |
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
|
767 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
769 |
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
|
770 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
772 |
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
|
773 |
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
|
774 |
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
|
775 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
777 |
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
|
778 |
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
|
779 |
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
|
780 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
782 |
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
|
783 |
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
|
784 |
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
|
785 |
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
|
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 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
790 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
793 |
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
|
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 |
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
|
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_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
|
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 |
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
|
802 |
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
|
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 |
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
|
805 |
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
|
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 |
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
|
808 |
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
|
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->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
|
811 |
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
|
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 |
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
|
814 |
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
|
815 |
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
|
816 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
819 |
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
|
820 |
{ |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
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 |
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
|
824 |
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
|
825 |
/* 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
|
826 |
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
|
827 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
829 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
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
|
831 |
} |
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
#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
|
834 |
|
b70b96e615d2
These files are the OpenGL ES render driver. You should be able to use them on any platform that 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 |
/* vi: set ts=4 sw=4 expandtab: */ |