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

Pages: [1]
1
Graphics / Partially drawing/hiding a sf::Shape::Line
« on: December 03, 2011, 11:22:49 am »
Quote from: "Walker"
(SFML2) Draw the map to a rendertexture and draw that with a sprite onto your HUD/UI.


Wow that was genius, didn't even know you could do that :D.

2
Graphics / Partially drawing/hiding a sf::Shape::Line
« on: December 02, 2011, 11:18:06 pm »
Hey

In short, how would I go about partially hiding sf::Shape::Line objects like sprites (setsubrect). The picture below explains my intents.

The map screen is scroll-able so the elements inside this frame are moving and obviously when they reach border of the frame, they will be hidden and not drawn at all.


3
General discussions / Confused about static linking
« on: June 24, 2011, 12:10:47 pm »
Well this is how I've been trying to do it:

1. Get newest snapshot from Github
2. Run Cmake on it, unticking BUILD_SHARED_LIBS and ticking STATIC_STD_LIBS
3. Open .sln file with Visual Studio
4. Run build on ALL_BUILD and it results -d libraries only :( (if release then there is no -d, but are still dyn linked).

I believe I missed something here in build options and thats the part where I'm confused.

4
General discussions / Confused about static linking
« on: June 23, 2011, 11:36:41 pm »
I am currently trying to accomplish this wonderful thing called static linking and I have no idea how this is done. I downloaded newest src of SFML 2.0 and ran Cmake with it. Then I ticked STATIC_STD_LIBS and pressed Generate. After that I have no clue how to proceed. Do I have to do something before I build SFML in Visual C++ 2010 and what do I have to do in project itself to enable static linking?

I've been trying something myself like messing with build options and adding SFML_STATIC on preprocessor, but I am still very confused how to get this work properly.

I'd love to hear how you guys do it.

5
SFML projects / GatorQue Engine (GQE or Basic Game Engine) Updates
« on: June 18, 2011, 08:13:53 pm »
Really sweet dude, looking forward for your new release :). Last time I used your engine as learning platform and it definitely helped me understand game engine design principles.

6
SFML projects / Thor C++ Library – An SFML extension
« on: April 19, 2011, 12:18:51 pm »
Definitely going to use this in my project, going to love particles and more functional clock/timer. It looks fairly simple even for a beginner. Going to toy around with this tonight :D.

7
SFML wiki / Game Engine tutorial
« on: April 15, 2011, 11:01:09 pm »
I love your engine design, GQE. I didn't directly copy paste or stuff like that, but I did learn a lot by studying your design philosophy (mainly manager classes, handlers and states) and have successfully applied them to my first game project.

One idea you could add would be how to properly do AI, but that might be too specific and far fetched though.

Keep up with good work man!

8
General / Crash on closing window [SFML2]
« on: April 14, 2011, 10:16:28 pm »
It works now, thanks man :).

9
General / Crash on closing window [SFML2]
« on: April 14, 2011, 09:03:01 pm »
Is there any update on this particular issue? I have this exact problem :(. I have ATI drivers and compiling on Visual Studio as well. Using Win7 and SFML2.

I noticed that this might be somewhat related to drawing text to the screen. Crashes started appearing right after I implemented interface for a game. I started commenting bits of this new code I just wrote (trying to isolate the cause of problem) and came to conclusion that if I don't draw any text to screen, I don't get any problem.

It is nothing major since on release builds it never crashes, but it would be nice if it doesn't happen while debugging :).

10
General / Game engine design, proper class instances handling
« on: April 12, 2011, 06:39:27 pm »
They don't say "Sometimes simplest solution is the best" for nothing, and it definitely applies right here. I got my stuff working immediately when I stopped using pointers and the new keyword.

Thanks for hints guys, I will most certainly try to make good use of them.

11
General / Game engine design, proper class instances handling
« on: April 12, 2011, 05:13:14 pm »
Quote from: "Groogy"
It's obvious you are not yet comfortable with C++.
Learn the language a bit more before you try to create a graphical game.

First and foremost, avoid using pointers and new. It's enough just having a vector like this:
Code: [Select]
std::vector<Object> objects;

Second you can remove them by providing an index like this:
Code: [Select]
objects.erase( objects.begin() + index );

This index can be seen as an ID for each object.

Also, you had objects inherit from ObjectHandler and ObjectHandler creates new objects? That's not where you want to use inheritance. Object should be it's own base-class.


Yeah I'm not definitely comfortable with C++ yet since I have been doing this for only for a month.

I'm aware of erase, but it doesn't free much memory at all, because my objects have pointers inside of them. Perhaps I can just remove them for now and just pass them as references. I'm just scared of memory leaks and stuff like that, so I thought I should improve my design. Perhaps I'm just trying to over-complicate it too much...

About inheritance, I thought it might be good idea to have inheritance because ObjectHandler holds a pointer to Game class, which has b2World and RenderWindow etc. and I obviously need them for drawing and syncing, however when I think about what you suggested, you're absolutely right. It might be much simpler to just have Object as a base class.

12
General / Game engine design, proper class instances handling
« on: April 12, 2011, 03:38:26 pm »
Hey,

I'm creating basic game from scratch using C++, SFML & Box2D. What I like to know is, how do you properly summon new object (like an instance of a class), how do you store it and how do you delete it from both game and memory?

I have tried having something like ObjectHandler which sub-class Object inherits from. ObjectHandler creates new instances of Object using "new" and adds them immediately to Vector. This obviously works when you add stuff in, but when it comes to destroying them, it starts getting really confusing. Basically I have no way of controlling those objects ever again if I just go like "Object * Box = new Object" all the time, so I'm looking for better solution.

Thank you in advance :).

13
Window / [SOLVED]Trying to create HUD on View (more elegant solution)
« on: April 08, 2011, 10:20:14 am »
Oh man, that was insanely simple, can't believe I missed that.

14
Window / [SOLVED]Trying to create HUD on View (more elegant solution)
« on: April 08, 2011, 09:39:01 am »
What I'm trying to do is simply have text on View so it will move when the View moves as well. I have accomplished by setting the text's position relative to View's center position, like this:

Code: [Select]
CountFPS.Update();
float x = View.GetCenter().x - 510;
float y = View.GetCenter().y - 388;
Text.SetPosition(x, y);
Text.SetText(CountFPS.GetFPS());
Screen->Draw(Text);


It is quite hacky in my opinion and requires lot of pixel perfection to get it right, also when I want more elements to the HUD, it will be quite a mess. Is there some more cleaner/elegant way to do this?

Thanks in advance.

Pages: [1]
anything