//Example
#include <SDL.h>
#include "SDL_EngineMain.h"
int main(int, char**)
{
//100%
SDL_Engine myEngine;
//100%
myEngine.Init(SDL_INIT_VIDEO);
//100%
myEngine.InitWindow(300, 200, SDL_ANYFORMAT);
//100%
myEngine.AddImage("bob.bmp");
//100%
myEngine.GetImage(0)->Setx(50);
SDL_Event event;
while (true)
{
if (SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
break;
}
//100%
myEngine.DrawImage(0);
//100%
myEngine.Flip();
}
//100%
myEngine.DeInit();
}
SDL engine up and running
Hi all! I managed to get my engine to work. It handles all the SDL stuff.
You can try it out too if you want.
Oh yeah. Anyways, I'll post the engine source when its ready, right now it handles SDL initialization, deinitialization, and Image(s). Image is a class used by SDL_Engine, but you can use it directly also. Once I get to making it handle music and ttf_text(<---ttf first) I will release it.
Quote:Original post by evolutional
Is it a C++ wrapper for SDL?
sounds like it.
@OP you don't have a link?
Yup. Actually, I dont know. It handles the specific SDL stuff instead of you doing it manually in functions. If you consider that a wrapper, yes it is.
P.S. I dont know really how to let you test it. Making it a .a only gives linker errors, so I included it into my project directly. Any ideas?
P.P.S. Though I wouldnt actually consider it a wrapper. I am aiming at making it handle all the image and text image stuff. And maybe music. Stuff that you normally initialize and use, not like keyboard input.
//Edit: I wrote 'P.S.S.' instead of 'P.P.S.'.
//Edit: Whats '@OP'?
P.S. I dont know really how to let you test it. Making it a .a only gives linker errors, so I included it into my project directly. Any ideas?
P.P.S. Though I wouldnt actually consider it a wrapper. I am aiming at making it handle all the image and text image stuff. And maybe music. Stuff that you normally initialize and use, not like keyboard input.
//Edit: I wrote 'P.S.S.' instead of 'P.P.S.'.
//Edit: Whats '@OP'?
@OP means 'To the original/originating poster'
If I said:
@evolutional: You are a staff member
That would mean that I am talking to Oli(evolutional) directly. It's just a shorthand notation to directing comments. OP is the 'original poster', which is always shorter than typing. or copy/pasting the person's name that started the thread. (O and P being right next to each other on the keyboard [wink])
If I said:
@evolutional: You are a staff member
That would mean that I am talking to Oli(evolutional) directly. It's just a shorthand notation to directing comments. OP is the 'original poster', which is always shorter than typing. or copy/pasting the person's name that started the thread. (O and P being right next to each other on the keyboard [wink])
Quote:Original post by rip-offQuote:Original post by evolutional
Is it a C++ wrapper for SDL?
sounds like it.
@OP you don't have a link?
Oh now I know what OP is. Well, no, I dont have a link. Even if I did, how would I upload the engine? I have it directly in my project(separate files though), because when I tried making it into a library it game me linker errors. Any ideas on it?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement