Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_wingl.c @ 1336:3692456e7b0f
Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 06:59:48 +0000 |
parents | 450721ad5436 |
children | 604d73db6802 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
78 { | 78 { |
79 const char *start; | 79 const char *start; |
80 const char *where, *terminator; | 80 const char *where, *terminator; |
81 | 81 |
82 /* Extension names should not have spaces. */ | 82 /* Extension names should not have spaces. */ |
83 where = strchr(extension, ' '); | 83 where = SDL_strchr(extension, ' '); |
84 if ( where || *extension == '\0' ) | 84 if ( where || *extension == '\0' ) |
85 return 0; | 85 return 0; |
86 | 86 |
87 if ( ! extensions ) | 87 if ( ! extensions ) |
88 return 0; | 88 return 0; |
93 | 93 |
94 start = extensions; | 94 start = extensions; |
95 | 95 |
96 for (;;) | 96 for (;;) |
97 { | 97 { |
98 where = strstr(start, extension); | 98 where = SDL_strstr(start, extension); |
99 if (!where) break; | 99 if (!where) break; |
100 | 100 |
101 terminator = where + strlen(extension); | 101 terminator = where + SDL_strlen(extension); |
102 if (where == start || *(where - 1) == ' ') | 102 if (where == start || *(where - 1) == ' ') |
103 if (*terminator == ' ' || *terminator == '\0') return 1; | 103 if (*terminator == ' ' || *terminator == '\0') return 1; |
104 | 104 |
105 start = terminator; | 105 start = terminator; |
106 } | 106 } |
189 SDL_SetError("Unable to get DC for SDL_Window"); | 189 SDL_SetError("Unable to get DC for SDL_Window"); |
190 return(-1); | 190 return(-1); |
191 } | 191 } |
192 | 192 |
193 /* Set up the pixel format descriptor with our needed format */ | 193 /* Set up the pixel format descriptor with our needed format */ |
194 memset(&GL_pfd, 0, sizeof(GL_pfd)); | 194 SDL_memset(&GL_pfd, 0, sizeof(GL_pfd)); |
195 GL_pfd.nSize = sizeof(GL_pfd); | 195 GL_pfd.nSize = sizeof(GL_pfd); |
196 GL_pfd.nVersion = 1; | 196 GL_pfd.nVersion = 1; |
197 GL_pfd.dwFlags = (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL); | 197 GL_pfd.dwFlags = (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL); |
198 if ( this->gl_config.double_buffer ) { | 198 if ( this->gl_config.double_buffer ) { |
199 GL_pfd.dwFlags |= PFD_DOUBLEBUFFER; | 199 GL_pfd.dwFlags |= PFD_DOUBLEBUFFER; |
532 | 532 |
533 /* Unload the old driver and reset the pointers */ | 533 /* Unload the old driver and reset the pointers */ |
534 WIN_GL_UnloadLibrary(this); | 534 WIN_GL_UnloadLibrary(this); |
535 | 535 |
536 /* Load new function pointers */ | 536 /* Load new function pointers */ |
537 memset(this->gl_data, 0, sizeof(*this->gl_data)); | 537 SDL_memset(this->gl_data, 0, sizeof(*this->gl_data)); |
538 this->gl_data->wglGetProcAddress = (void * (WINAPI *)(const char *)) | 538 this->gl_data->wglGetProcAddress = (void * (WINAPI *)(const char *)) |
539 GetProcAddress(handle, "wglGetProcAddress"); | 539 GetProcAddress(handle, "wglGetProcAddress"); |
540 this->gl_data->wglCreateContext = (HGLRC (WINAPI *)(HDC)) | 540 this->gl_data->wglCreateContext = (HGLRC (WINAPI *)(HDC)) |
541 GetProcAddress(handle, "wglCreateContext"); | 541 GetProcAddress(handle, "wglCreateContext"); |
542 this->gl_data->wglDeleteContext = (BOOL (WINAPI *)(HGLRC)) | 542 this->gl_data->wglDeleteContext = (BOOL (WINAPI *)(HGLRC)) |
552 FreeLibrary(handle); | 552 FreeLibrary(handle); |
553 return -1; | 553 return -1; |
554 } | 554 } |
555 | 555 |
556 this->gl_config.dll_handle = handle; | 556 this->gl_config.dll_handle = handle; |
557 strcpy(this->gl_config.driver_path, path); | 557 SDL_strcpy(this->gl_config.driver_path, path); |
558 this->gl_config.driver_loaded = 1; | 558 this->gl_config.driver_loaded = 1; |
559 return 0; | 559 return 0; |
560 } | 560 } |
561 | 561 |
562 void *WIN_GL_GetProcAddress(_THIS, const char* proc) | 562 void *WIN_GL_GetProcAddress(_THIS, const char* proc) |