Re: SDL2 Wrapper Not Working Under 4.1.0
- Posted by Icy_Viking Sep 16, 2014
- 2196 views
Yes it appears that 64-bit is the only one working under 4.1.0 as of right now.
Can someone help me with this? When I try to run the code below, it says bad routine number (1). It appears I am not doing something right when loading images in SDL, or perhaps I am not going about it the correct way?
include std/get.e include std/io.e include std/machine.e include EuSDL2.ew atom dummy = SDL_Init(SDL_INIT_EVERYTHING) if dummy = -1 then puts(1,"Could not initailize SDL!\n") abort(1) end if atom win = SDL_CreateWindow("Win",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,640,480,SDL_WINDOW_SHOWN) atom surf = SDL_GetWindowSurface(win) atom pic = SDL_LoadBMP("EPic.bmp") atom rect = allocate(16) poke4(rect,{100,100,100,100}) if win = -1 then puts(1,"Could not create window!\n") abort(1) end if atom key = 0 atom running = 1 while running = 1 do SDL_PumpEvents() key = SDL_GetKeyboardState(key) if (peek(key+SDL_SCANCODE_ESCAPE) > 0) then running = 0 end if dummy = SDL_BlitSurface(pic,0,win,rect) --Here it says bad routine number (1) SDL_UpdateWindowSurface(win) end while SDL_FreeSurface(pic) SDL_FreeSurface(surf) SDL_DestroyWindow(win) SDL_Quit()