7463B7EA12F9D11E00983F6A /* mod_skeletal_animatevertices_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B7E812F9D11E00983F6A /* mod_skeletal_animatevertices_sse.c */; };
7463B7EF12F9D17D00983F6A /* builddate.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B7ED12F9D17D00983F6A /* builddate.c */; };
7463B7F012F9D17D00983F6A /* clvm_cmds.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B7EE12F9D17D00983F6A /* clvm_cmds.c */; };
+ 7487D481130102AA00AEE909 /* thread_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 7487D47F130102AA00AEE909 /* thread_sdl.c */; };
FD779ED20E26B9B000F39101 /* libSDLSimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779ED00E26B9B000F39101 /* libSDLSimulator.a */; };
FD779ED30E26B9B000F39101 /* libSDLiPhoneOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779ED10E26B9B000F39101 /* libSDLiPhoneOS.a */; };
FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; };
7463B7E912F9D11E00983F6A /* mod_skeletal_animatevertices_sse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mod_skeletal_animatevertices_sse.h; sourceTree = "<group>"; };
7463B7ED12F9D17D00983F6A /* builddate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = builddate.c; sourceTree = "<group>"; };
7463B7EE12F9D17D00983F6A /* clvm_cmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = clvm_cmds.c; sourceTree = "<group>"; };
+ 7487D47F130102AA00AEE909 /* thread_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = thread_sdl.c; sourceTree = "<group>"; };
+ 7487D480130102AA00AEE909 /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FD779ED00E26B9B000F39101 /* libSDLSimulator.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDLSimulator.a; path = lib/libSDLSimulator.a; sourceTree = "<group>"; };
FD779ED10E26B9B000F39101 /* libSDLiPhoneOS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDLiPhoneOS.a; path = lib/libSDLiPhoneOS.a; sourceTree = "<group>"; };
29B97315FDCFA39411CA2CEA /* Sources */ = {
isa = PBXGroup;
children = (
+ 7487D47F130102AA00AEE909 /* thread_sdl.c */,
+ 7487D480130102AA00AEE909 /* thread.h */,
7463B7ED12F9D17D00983F6A /* builddate.c */,
7463B7EE12F9D17D00983F6A /* clvm_cmds.c */,
7463B7E812F9D11E00983F6A /* mod_skeletal_animatevertices_sse.c */,
7463B7EA12F9D11E00983F6A /* mod_skeletal_animatevertices_sse.c in Sources */,
7463B7EF12F9D17D00983F6A /* builddate.c in Sources */,
7463B7F012F9D17D00983F6A /* clvm_cmds.c in Sources */,
+ 7487D481130102AA00AEE909 /* thread_sdl.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Boston, MA 02111-1307, USA
*/
+#ifdef __APPLE__
+// include SDL for IPHONEOS code
+# include <TargetConditionals.h>
+# if TARGET_OS_IPHONE
+# include <SDL.h>
+# endif
+#endif
+
#include <limits.h>
#include <fcntl.h>
size_t homedirlen;
#endif
#endif
+#ifndef __IPHONEOS__
char *homedir;
+#endif
#ifdef WIN32
const char* dllnames [] =
// don't care for the result; if it fails, %USERPROFILE% will be used instead
#endif
+ *fs_basedir = 0;
+ *fs_userdir = 0;
+ *fs_gamedir = 0;
+
+#ifdef __IPHONEOS__
+ // FIXME: set fs_userdir to the documents folder
+#else
// Add the personal game directory
if((i = COM_CheckParm("-userdir")) && i < com_argc - 1)
{
fs_basedir[split - com_argv[0]] = 0;
}
#endif
+#endif
#endif
// -basedir <path>
qglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
qglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
qglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
- qglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, gl_state.defaultframebufferobject);
+ if (vid.support.ext_framebuffer_object)
+ qglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, gl_state.defaultframebufferobject);
qglEnableVertexAttribArray(GLES2ATTRIB_POSITION);
qglVertexAttribPointer(GLES2ATTRIB_POSITION, 3, GL_FLOAT, false, sizeof(float[3]), NULL);CHECKGLERROR
qglDisableVertexAttribArray(GLES2ATTRIB_COLOR);
// GLES does not have glDrawRangeElements, and generally
// underperforms with index buffers, so this code path is
// relatively straightforward...
+ //if (qglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT)
+ // Con_DPrintf("fbo %i not complete (default %i)\n", gl_state.framebufferobject, gl_state.defaultframebufferobject);
if (element3s)
{
qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_SHORT, element3s);
textypeinfo_t;
-static textypeinfo_t textype_palette = {TEXTYPE_PALETTE , 1, 4, 4.0f, 3 , GL_BGRA , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_palette_alpha = {TEXTYPE_PALETTE , 1, 4, 4.0f, 4 , GL_BGRA , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_rgba = {TEXTYPE_RGBA , 4, 4, 4.0f, 3 , GL_RGBA , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_rgba_alpha = {TEXTYPE_RGBA , 4, 4, 4.0f, 4 , GL_RGBA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_palette = {TEXTYPE_PALETTE , 1, 4, 4.0f, GL_RGBA , GL_BGRA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_palette_alpha = {TEXTYPE_PALETTE , 1, 4, 4.0f, GL_RGBA , GL_BGRA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_rgba = {TEXTYPE_RGBA , 4, 4, 4.0f, GL_RGBA , GL_RGBA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_rgba_alpha = {TEXTYPE_RGBA , 4, 4, 4.0f, GL_RGBA , GL_RGBA , GL_UNSIGNED_BYTE };
static textypeinfo_t textype_rgba_compress = {TEXTYPE_RGBA , 4, 4, 0.5f, GL_COMPRESSED_RGB_S3TC_DXT1_EXT , GL_RGBA , GL_UNSIGNED_BYTE };
static textypeinfo_t textype_rgba_alpha_compress = {TEXTYPE_RGBA , 4, 4, 1.0f, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_bgra = {TEXTYPE_BGRA , 4, 4, 4.0f, 3 , GL_BGRA , GL_UNSIGNED_BYTE };
-static textypeinfo_t textype_bgra_alpha = {TEXTYPE_BGRA , 4, 4, 4.0f, 4 , GL_BGRA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_bgra = {TEXTYPE_BGRA , 4, 4, 4.0f, GL_RGBA , GL_BGRA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_bgra_alpha = {TEXTYPE_BGRA , 4, 4, 4.0f, GL_RGBA , GL_BGRA , GL_UNSIGNED_BYTE };
static textypeinfo_t textype_bgra_compress = {TEXTYPE_BGRA , 4, 4, 0.5f, GL_COMPRESSED_RGB_S3TC_DXT1_EXT , GL_BGRA , GL_UNSIGNED_BYTE };
static textypeinfo_t textype_bgra_alpha_compress = {TEXTYPE_BGRA , 4, 4, 1.0f, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_BGRA , GL_UNSIGNED_BYTE };
static textypeinfo_t textype_shadowmap16 = {TEXTYPE_SHADOWMAP , 2, 2, 2.0f, GL_DEPTH_COMPONENT16_ARB , GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT};
static textypeinfo_t textype_dxt1a = {TEXTYPE_DXT1A , 4, 0, 0.5f, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 0 , 0 };
static textypeinfo_t textype_dxt3 = {TEXTYPE_DXT3 , 4, 0, 1.0f, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 0 , 0 };
static textypeinfo_t textype_dxt5 = {TEXTYPE_DXT5 , 4, 0, 1.0f, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 0 , 0 };
-static textypeinfo_t textype_colorbuffer = {TEXTYPE_COLORBUFFER, 4, 4, 4.0f, 4 , GL_BGRA , GL_UNSIGNED_BYTE };
+static textypeinfo_t textype_colorbuffer = {TEXTYPE_COLORBUFFER, 4, 4, 4.0f, GL_RGBA , GL_BGRA , GL_UNSIGNED_BYTE };
typedef enum gltexturetype_e
qglGetActiveUniform = wrapglGetActiveUniform;
qglGetAttachedShaders = wrapglGetAttachedShaders;
qglGetBooleanv = wrapglGetBooleanv;
- qglGetCompressedTexImageARB = wrapglGetCompressedTexImage;
+// qglGetCompressedTexImageARB = wrapglGetCompressedTexImage;
qglGetDoublev = wrapglGetDoublev;
qglGetFloatv = wrapglGetFloatv;
qglGetFramebufferAttachmentParameterivEXT = wrapglGetFramebufferAttachmentParameteriv;
qglPointSize = wrapglPointSize;
qglPolygonMode = wrapglPolygonMode;
qglPolygonOffset = wrapglPolygonOffset;
- qglPolygonStipple = wrapglPolygonStipple;
+// qglPolygonStipple = wrapglPolygonStipple;
qglReadBuffer = wrapglReadBuffer;
qglReadPixels = wrapglReadPixels;
qglRenderbufferStorageEXT = wrapglRenderbufferStorage;
vid.support.ext_blend_minmax = false;
vid.support.ext_blend_subtract = true;
vid.support.ext_draw_range_elements = true;
- vid.support.ext_framebuffer_object = true;
+ vid.support.ext_framebuffer_object = false;//true;
vid.support.ext_stencil_two_side = false;
vid.support.ext_texture_3d = false;//SDL_GL_ExtensionSupported("GL_OES_texture_3D"); // iPhoneOS does not support 3D textures, odd...
vid.support.ext_texture_compression_s3tc = false;
else
SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 0);
#else
- // TODO: SDL_GL_CONTEXT_MAJOR_VERSION, SDL_GL_CONTEXT_MINOR_VERSION
+#ifdef __IPHONEOS__
+ SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 2);
+ SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 0);
+ SDL_GL_SetAttribute (SDL_GL_RETAINED_BACKING, 1);
+ // FIXME: get proper resolution from OS somehow (iPad for instance...)
+ mode->width = 320;
+ mode->height = 480;
+#endif
#endif
video_bpp = mode->bitsperpixel;
return false;
}
+ mode->width = screen->w;
+ mode->height = screen->h;
vid_softsurface = NULL;
vid.softpixels = NULL;
#define sscanf sscanf_s
#endif
-#ifndef __IPHONEOS__
qboolean GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent)
{
int failed = false;
Cvar_SetQuick(&gl_info_platform, gl_platform ? gl_platform : "");
Cvar_SetQuick(&gl_info_driver, gl_driver);
}
-#endif // __IPHONEOS__
void Force_CenterView_f (void)
{