Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SDL Help


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Poppit   Members   -  Reputation: 100

Like
0Likes
Like

Posted 12 March 2012 - 06:28 PM

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.

#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




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

Sponsor:

#2 Smacker_626   Members   -  Reputation: 126

Like
1Likes
Like

Posted 12 March 2012 - 08:41 PM

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.

#3 Poppit   Members   -  Reputation: 100

Like
0Likes
Like

Posted 13 March 2012 - 05:11 PM

Thank you for your help. It worked :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS