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:

enter image description here

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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -