Sign in to follow this  
Poppit

SDL Help

Recommended Posts

Poppit    100
Hello,

I am learning SDL atm and trying to make a very basic graphics engine to make a tetris clone. I have been able to fix every bug I have made except for this one: error: SDL_Surface does not name a type.

[source]#ifndef GAMEEVENTS_H
#define GAMEEVENTS_H
#include "intergers.h"
class gameEvents
{
private:
bool gameRunning;
SDL_Surface screen(); //Right here
public:
gameEvents();
void gameLoad();
void gameInit();
void gameInput();
void gameDraw();
void gameUpdate();
void gameClean();
bool gameState();
};
#endif GAMEEVENTS_H
[/source]


This little bug has had me stalled for at least 6 Hours. -.-
Any help is appreciated.

Share this post


Link to post
Share on other sites
Smacker_626    126
gameEvents::screen() is returning an SDL_Surface, are you sure you don't want to return a pointer to an SDL_Surface instead? If you do, that should solve your problem since the code you posted doesn't actually make use of the SDL_Surface.

Any code that actually works with an SDL_Surface will need "SDL.h" included to bring in the definition.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this