Jump to content
  • Advertisement
Sign in to follow this  
dudedbz1

SDL engine up and running

This topic is 4625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! I managed to get my engine to work. It handles all the SDL stuff.
//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();
}

You can try it out too if you want.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by evolutional
Is it a C++ wrapper for SDL?


sounds like it.

@OP you don't have a link?

Share this post


Link to post
Share on other sites
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'?

Share this post


Link to post
Share on other sites
@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])

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
Quote:
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?

Share this post


Link to post
Share on other sites
Quote:
Original post by White Scorpion
I doubt it's useful in any way to make SDL even more higher-level than it is.


Wow, thanks a bunch.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!