Jump to content
  • Advertisement
Sign in to follow this  

SDL Help

This topic is 2413 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


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
#include "intergers.h"
class gameEvents
bool gameRunning;
SDL_Surface screen(); //Right here
void gameLoad();
void gameInit();
void gameInput();
void gameDraw();
void gameUpdate();
void gameClean();
bool gameState();

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
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
Sign in to follow this  

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!