sdl - Access violation at SDL_CreateRenderer -
i use vc++ 2010 express , working on project when try use sdl_createrenderer function error:
first-chance exception @ 0x6c8037be in oyun projem.exe: 0xc0000005: access violation reading location 0x00000010. unhandled exception @ 0x6c8037be in oyun projem.exe: 0xc0000005: access violation reading location 0x00000010. program '[320] oyun projem.exe: native' has exited code -1073741819 (0xc0000005).
at line:
renderer = sdl_createrenderer(window, -1, sdl_renderer_accelerated);
here code
#include "stdafx.h" int main(int argc, char* argv[]) { sdl_init(sdl_init_video); sdl_window *window; sdl_renderer *renderer; window = null; window = sdl_createwindow("my first rpg!", 100, 100, 100, 100, sdl_window_shown); renderer = sdl_createrenderer(window, -1, sdl_renderer_accelerated); return 0; }
here see when debugging:
sdl_createwindow
returns null if there failure. code needs check this.
// code: window = sdl_createwindow("my first rpg!", 100, 100, 100, 100, sdl_window_shown); // add following: // check window made if (window == null) { // in event window not made... printf("could not create window: %s\n", sdl_geterror()); return 1; }
Comments
Post a Comment