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 - firstep

Pages: [1]
1
General / Re: Code of sfml book?
« on: October 11, 2014, 04:23:52 pm »
I declare the header file on aircraft.h to be able to get the variable of ResourceHolder.
Please express yourself clearly, I have no idea what you mean. Make sure you're using the correct terms and illustrate the problem with code, if necessary.

What i mean by this is this
#include "Entity.h"
#include "ResourceHolder.h"

Its on the Aircraft class

class Aircraft : public Entity
{
public:
        enum class Type{
                Eagle,
                Raptor
        };


        Aircraft(Type type, const this_undefined& textures);
        virtual void drawCurrent(sf::RenderTarget &target, sf::RenderStates states) const;
       
private:
        Type mType;
        sf::Sprite mSprite;
};

which i was expecting that i could get the this_undefined variable without any errors.



2
General / Re: Code of sfml book?
« on: October 11, 2014, 03:44:15 pm »
Im stuck. I tried all that i know. I declare the header file on aircraft.h to be able to get the variable of ResourceHolder.

Another thing is that the code from the link has also this

namespace sf
{
class Texture;
}
namespace Textures
{
enum ID
{
Eagle,
Raptor,
Desert,
};
}
// Forward declaration and a few type definitions
template <typename Resource, typename Identifier>
class ResourceHolder;
typedef ResourceHolder<sf::Texture, Textures::ID> TextureHolder;

which for me doesnt make any sense as it could be declare on resourceHolder alone. So why bother creating another file?

3
General / Code of sfml book?
« on: October 11, 2014, 03:25:43 pm »
Code of sfml book and the actual tutorial is different?

Im on chapter and i got one error where VS can is saying the my TextureHolder is undefined. I cant figure out how to solve it. I declare all the header on my aircraft.h

But when i look on the code of sfml book there is this ResourceIdentifiers. Its not event mentioned in the book

Here is my whole code
#include "Entity.h"
#include "ResourceHolder.h"
class Aircraft : public Entity
{
public:
        enum class Type{
                Eagle,
                Raptor
        };


        Aircraft(Type type, const this_undefined& textures); <--------- this is the error; its undefined
        virtual void drawCurrent(sf::RenderTarget &target, sf::RenderStates states) const;
       
private:
        Type mType;
        sf::Sprite mSprite;
};
 
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include<assert.h>
#include<map>
#include <iostream>
#include <memory>
using namespace std;

namespace Textures{
        enum class Type{
                Eagle,
                Raptor
        };
}


template<typename Resource, typename Identifier>
class ResourceHolder{
public:
        void load(Identifier id, const std::string &filename);

        template<typename Parameter>
        void load(Identifier id, const std::string &filename, const Parameter &secondParam);

        Resource &get(Identifier id);
        const Resource &get(Identifier id) const;
       

        typedef ResourceHolder<sf::Texture, Textures::Type> this_undenfined;

private:
        std::map<Identifier, std::unique_ptr<Resource>> mResourceMap;
       
};

This is the code im following on the book. But i dont know why the "this_undefined" variable is undefined in my IDE

NOTE: I change it to the word "this_undefined"  to highlight the error

4
General / Re: understanding scene graph better?
« on: October 08, 2014, 04:58:07 pm »
Sorry for being persistent but Is it right to view this scene graph as like a space? where every node is an object?

5
General / Re: understanding scene graph better?
« on: October 06, 2014, 05:44:05 pm »
The scene graph does not represent the world, but rather the scene (i.e. mainly the visualized part of the world). And it's just one of many approaches, which has the advantage of expressing relative transforms very easily.


Thanks.


When you don't understand scene graphs, you should first read about their purpose -- e.g. on Wikipedia or game development articles -- and not a blog describing a specific problem in a specific situation.
Yeah i read the wikipedia but it only view it as a tree data.

6
General / Re: understanding scene graph better?
« on: October 06, 2014, 03:50:41 pm »
There is a text you can read about them: http://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BScene%20Graphs%20-%20just%20say%20no%5D%5D

Hi, Thanks for the link. I somehow understand the scene graph but i cant understand most of the part about traversing. Im just a noobie in game development and have no idea what the author means by that.

Anyway if this scene graph thingy is such a bad idea, I wonder why the author of the SFML book use it. I mean it could be a plus for them for teaching some aspiring developers to use a proper technique which they learned from SFML. But i guest that that only applies to 3D.

7
General / understanding scene graph better?
« on: October 06, 2014, 03:26:04 pm »
Im having a trouble visualizing scene graph in my head. I read some blogs and it said that scene graph is like a stage? If this is right then what is scene node?

In Cs terms its a tree data. But in game how can you visualize it? In SFML book it said

Quote
A scene graph contains a root scene node, which exists only once in a world.

The term world makes me think to visualize this scene graph as a world? is this right? So this root scene node is the origin? Like for example the (0,0) top-left coordinate?

8
General / Re: SFML book code?
« on: October 04, 2014, 04:06:44 pm »
Nope. Dont bother with this thread. Im sorry.. I found it..

9
General / SFML book code?
« on: October 04, 2014, 03:56:14 pm »
I think the codes on SFML is not complete.

Quote
Quote
The two overloaded get() member functions are generalized using the same principle, that is why they are not listed here. You can refer to the online code base for a complete implementation.

I tried to look at the code sample i downloaded but i still cant find the ResourceHolder class. The book and the online code base is not the same.

10
General / Re: clion and sfml?
« on: September 14, 2014, 08:14:05 am »
Hi,

I cant see the clion option on cmake.

Can you teach me step by step if not too much?

11
General discussions / Re: SFML 3 - What is your vision?
« on: September 13, 2014, 10:54:26 am »
cLion support :D

12
General / Re: clion and sfml?
« on: September 10, 2014, 10:06:53 am »
One good thing to do would be learning how to configure projects with CMake as CLion uses it too :D

Do i need to learn Cmake then?

13
General discussions / Re: CLion - A new IDE from JetBrains
« on: September 10, 2014, 04:52:08 am »
How to integrate sfml and clion IDE? sorry im not a techie.. Just started learning c++

14
General / clion and sfml?
« on: September 10, 2014, 04:50:08 am »
I am using mac osx. I hate xcode and eclipse. They are super slow. Just wanna try the new jetbrains IDE for c++ named clion. Im not a c++ PRO and just only started learning it so i dont know how to integrate sfml in clion

Can you guys help me?

Thanks

Pages: [1]
anything