Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - beginner88

Pages: [1]
1
SFML wiki / [Problem]Manage different screens in a game
« on: June 23, 2009, 04:05:04 pm »
Ok thx, I added include guards and can now run the program.
The bigger problem is, that the program doesn´t work like it should do.
That means that the menu isn´t working exactly (it doesn´t disappear when the game is starting) or I could finish the program about the menu.

I don´t now who else than me did this tutorial, because it would be really nice if another guy would send me an .exe file and the source from him, when it´s working on his system :)

2
SFML wiki / [Problem]Manage different screens in a game
« on: June 21, 2009, 10:12:58 pm »
Hi,

I just did the very usefull tutorial to manage different screens in games (or sfml applications).
But something couldn´t be right in this tutorial, because I got a lot of errors, although I had copy&paste the whole code.

Ok, my project includes 4 header files and one main(cpp) file.
The header files are called screen.h, screens.h, screen_0.h and screen_1.h.
In the header file screens.h I included the basic class (in the header file screen.h) and the two other classes.
I think till now everything should be ok, but than there comes some strange things. For example, in the tutorial the basic class (in screen.h) is declared as
Code: [Select]
class cScreen
{
//...
};

and the main function says
Code: [Select]

std::vector<cScreen*> Screens;

Allright, but in screen_0.h "class screen_0" inherit from cScreen, but the author wrotes
Code: [Select]

class screen_0 : public Screen
{
private:
//...
};

As you can see is this a mistake.

But I fixed such mistakes, compiled the code and get errors like
Quote
error C2011: 'Screen': 'class' Typeredefinition

for the basicclass.
And for the code, where one class inherit from the basicclass
Quote
Basicclass undefined
.

Does anybody else this tutorial and got the same or similar problems?
I really got no idea what could be wrong with this code.
Would be really really nice if somebody could compile the code on his system and help me!
Thanks in advance!

3
General / error LNK2001
« on: June 04, 2009, 12:48:16 pm »
Thanks a lot Laurent! :D

4
General / error LNK2001
« on: June 04, 2009, 01:54:54 am »
Hi everybody again,

I just got a little freaky problem. I know that the LNK2001 error should mean that I didn´t linked a library, but I linked all librarys I know so far^^

Code: [Select]
sfml-system-d.lib sfml-window-d.lib sfml-graphics-d.lib sfml-audio-d.lib sfml-network-d.lib

Although the network library isn´t necessary in my case, I linked it because I wasn´t sure... :oops:

The whole error: (I´m sorry that some parts in german)
Code: [Select]
1>main.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA)".
1>P:\Projekte SFML\Pong-Clon\Debug\Pong-Clon.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.


I hope someone could help me!
thx, Felix

5
General / Classes and SFML
« on: December 27, 2008, 06:02:38 pm »
Sorry that my answer comes quite late, but I used to spend the holidays with my familie and girlfriend :)

@irri: Ok, thanks for your suggestions, I think I´ll try it during the next few days...

6
General / Classes and SFML
« on: December 24, 2008, 12:27:11 pm »
Thank you both!
@Wizzard: It´s just to practice how to use an API and C++ :)

@irri: Ok, but I thought when I get a class, for example, CPlayer with all his attributes like Health, Amor, etc. that I could use the sf::Image, sf::Sprite function in my class, to keep everything together... of course this is just an easy example and I know that it is more difficult in a "real" game.

Quote
Code: [Select]
// Draws the CSprite using the Render function
window.Draw(sprite);

If I would call this in the main function (while(Window.IsOpen())); I would try to render the instance of the CSprite class ( :?: ).

7
General / Classes and SFML
« on: December 24, 2008, 12:12:38 am »
Hey :)

first at all, I´m new at programming and total new on programming with an API.
My first steps with SFML were very comfortable, it´s really easie to load some sprites, etc. But now I thought I could write the sf::Image, or sf::String function in a class, to make my source more clearly.

I read some post in the forum and came to a solution
Code: [Select]

class CSprite
{
public:
sf::String string;

virtual void Render(const sf::RenderWindow &Window) const
{
Window.Draw(string);
}
};


The main function

Code: [Select]

CSprite sprite;


And what now?
How should the render function look like?

Code: [Select]

sprite.Render(Window);
/* ??? */

And what is the best option to set the parameters?

Sorry for the many questions but I´ve never worked with an API befor and I spent a lot of time infront of my screen but I didn´t get a result :?

So are my ideas possible, or how would you handle this situation?

Pages: [1]
anything