diff src/video/SDL_video.c @ 1920:8a162bfdc838

Convert SDL_malloc to SDL_calloc if appropriate, slightly faster on operating systems which map the zero page for memory allocations. OpenGL renderer in progress
author Sam Lantinga <slouken@libsdl.org>
date Sat, 22 Jul 2006 08:33:18 +0000
parents 00816063b9c9
children d4572b97b08f
line wrap: on
line diff
--- a/src/video/SDL_video.c	Wed Jul 19 08:46:57 2006 +0000
+++ b/src/video/SDL_video.c	Sat Jul 22 08:33:18 2006 +0000
@@ -279,10 +279,10 @@
 
     /* The software renderer is always available */
     for (i = 0; i < _this->num_displays; ++i) {
+#if SDL_VIDEO_OPENGL
+        SDL_AddRenderDriver(i, &GL_RenderDriver);
+#endif
         if (_this->displays[i].num_render_drivers > 0) {
-#if 0 //SDL_VIDEO_OPENGL
-            SDL_AddRenderDriver(i, &GL_RenderDriver);
-#endif
             SDL_AddRenderDriver(i, &SW_RenderDriver);
         }
     }
@@ -1403,13 +1403,12 @@
         return 0;
     }
 
-    texture = (SDL_Texture *) SDL_malloc(sizeof(*texture));
+    texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
     if (!texture) {
         SDL_OutOfMemory();
         return 0;
     }
 
-    SDL_zerop(texture);
     texture->id = _this->next_object_id++;
     texture->format = format;
     texture->access = access;