]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
Fix shader compile log again. Print error in any case, warnings only if developer...
[xonotic/darkplaces.git] / vid_sdl.c
index 9af5f2c30af66a77b43792f622d553d5c16120ea..024355253bf92d6ce5479659c9cb303b60919154 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -380,7 +380,7 @@ SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window);  // returns whether or
 int SDL_iPhoneKeyboardToggle(SDL_Window * window); // toggles the visibility of the onscreen keyboard.  Returns 0 on success and -1 on error.
 #endif
 
-void VID_ShowKeyboard(qboolean show)
+static void VID_ShowKeyboard(qboolean show)
 {
 #ifdef __IPHONEOS__
        if (show)
@@ -486,7 +486,7 @@ void VID_SetMouse(qboolean fullscreengrab, qboolean relative, qboolean hidecurso
 #define MAXFINGERS 11
 int multitouch[MAXFINGERS][3];
 
-qboolean VID_TouchscreenArea(int corner, float px, float py, float pwidth, float pheight, const char *icon, float *resultmove, qboolean *resultbutton, keynum_t key)
+static qboolean VID_TouchscreenArea(int corner, float px, float py, float pwidth, float pheight, const char *icon, float *resultmove, qboolean *resultbutton, keynum_t key)
 {
        int finger;
        float fx, fy, fwidth, fheight;
@@ -1572,6 +1572,15 @@ void GLES_Init(void)
        vid.support.ext_blend_subtract = true;
        vid.support.ext_draw_range_elements = true;
        vid.support.ext_framebuffer_object = false;//true;
+
+       // FIXME remove this workaround once FBO + npot texture mapping is fixed
+       if(!vid.support.arb_texture_non_power_of_two)
+       {
+               vid.support.arb_framebuffer_object = false;
+               vid.support.ext_framebuffer_object = false;
+       }
+
+       vid.support.ext_packed_depth_stencil = false;
        vid.support.ext_stencil_two_side = false;
        vid.support.ext_texture_3d = SDL_GL_ExtensionSupported("GL_OES_texture_3D");
        vid.support.ext_texture_compression_s3tc = SDL_GL_ExtensionSupported("GL_EXT_texture_compression_s3tc");
@@ -1810,7 +1819,7 @@ static SDL_Surface *VID_WrapSDL_SetVideoMode(int screenwidth, int screenheight,
 
                        // reallocate with malloc, as this is in tempmempool (do not want)
                        xpm = data;
-                       data = malloc(width * height * 4);
+                       data = (char *) malloc(width * height * 4);
                        memcpy(data, xpm, width * height * 4);
                        Mem_Free(xpm);
                        xpm = NULL;
@@ -1964,6 +1973,7 @@ static SDL_Surface *VID_WrapSDL_SetVideoMode(int screenwidth, int screenheight,
                                static long netwm_icon[MAX_NETWM_ICON];
                                int pos = 0;
                                int i = 1;
+                               char vabuf[1024];
 
                                while(data)
                                {
@@ -1981,7 +1991,7 @@ static SDL_Surface *VID_WrapSDL_SetVideoMode(int screenwidth, int screenheight,
                                        }
                                        ++i;
                                        Mem_Free(data);
-                                       data = (char *) loadimagepixelsbgra(va("darkplaces-icon%d", i), false, false, false, NULL);
+                                       data = (char *) loadimagepixelsbgra(va(vabuf, sizeof(vabuf), "darkplaces-icon%d", i), false, false, false, NULL);
                                }
 
                                info.info.x11.lock_func();
@@ -2011,7 +2021,7 @@ static void VID_OutputVersion(void)
                                        version->major, version->minor, version->patch );
 }
 
-qboolean VID_InitModeGL(viddef_mode_t *mode)
+static qboolean VID_InitModeGL(viddef_mode_t *mode)
 {
        int i;
 #if SETVIDEOMODE
@@ -2045,6 +2055,7 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
        notfirstvideomode = true;
 #endif
 
+#ifndef USE_GLES2
        // SDL usually knows best
        drivername = NULL;
 
@@ -2057,6 +2068,7 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
                Con_Printf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
                return false;
        }
+#endif
 
 #ifdef __IPHONEOS__
        // mobile platforms are always fullscreen, we'll get the resolution after opening the window
@@ -2196,7 +2208,7 @@ extern cvar_t gl_info_version;
 extern cvar_t gl_info_platform;
 extern cvar_t gl_info_driver;
 
-qboolean VID_InitModeSoft(viddef_mode_t *mode)
+static qboolean VID_InitModeSoft(viddef_mode_t *mode)
 {
 #if SETVIDEOMODE
        int flags = SDL_HWSURFACE;