Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "CApp.h"
- CApp::CApp()
- {
- gameWindow = NULL;
- gameRenderer = NULL;
- testSurface = NULL;
- testImg = NULL;
- Running = true;
- }
- int CApp::OnExecute()
- {
- if(OnInit() == false)
- {
- return -1;
- }
- //Image Details
- testSurface = SDL_LoadBMP("myimage.bmp");
- testImg = SDL_CreateTextureFromSurface(gameRenderer, testSurface);
- SDL_FreeSurface(testSurface);
- testRect.x = 640/2; testRect.y = 480/2; testRect.w = 50; testRect.h = 50;
- //Events
- SDL_Event Event;
- while(Running)
- {
- while(SDL_PollEvent(&Event))
- {
- OnEvent(&Event);
- }
- OnLoop();
- OnRender();
- }
- OnCleanup();
- return 0;
- }
- int main(int argc, char* argv[])
- {
- CApp theApp;
- return theApp.OnExecute();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement