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

Pages: [1] 2 3 ... 5
1
I think music is too vast to be MCQ'ed.
I mainly listen to progressive metal (Fair to Midland, Dream Theater, Green Carnation), doom jazz (Bohren und der club of Gore) and 19th century 'classical' music (Gustav Mahler, Offenbach), none of which are options - expectedly.
Also, you didn't start with your own preferences :p

2
General / Re: Trapping function keys
« on: February 07, 2013, 10:55:58 am »
I can probably disable this special behaviour in SFML, but first I'd like to find what it's supposed to mean for the OS.

Quote
F10 : In Microsoft Windows activates the menu bar of an open application.

It's pretty much the same behaviour as the "ALT" key.

3
General / Re: Trapping function keys
« on: February 07, 2013, 10:30:22 am »
Any news on this ? This is a pretty old thread, yet the issue is still present. Is the solution GAFBlizzard proposed a bad one ? If so, what would be a better one ? If not, what prevents it from being merged into the main repository ?

4
General discussions / Re: Communication between threads
« on: December 12, 2012, 02:39:45 pm »
Yeah, multi-threaded game engines only appeared quite recently. For your first few games, don't bother with it, you'll understand in time how they can be useful.

5
General / Re: HTML table rendering to a window
« on: December 11, 2012, 08:55:48 pm »
Maybe you want something more like Qt than SFML ?

6
The sprite's "color" is only a filter, that is multiplied with its texture.

7
SFML website / Re: How can I know or at least bookmark my own post?
« on: December 08, 2012, 08:25:15 pm »
Go to Profile Tab, then hover "Profile Info" on the left, "Show Posts", then "Messages" (or "Topic") if you prefer.

8
General / Re: Move sprite to attack a random target.
« on: December 08, 2012, 07:49:38 pm »
<_< Yeah, typo...

9
General / Re: Move sprite to attack a random target.
« on: December 08, 2012, 07:42:59 pm »
Read the distance formula again. You're multiplying instead of substracting the y values.
You could also use the delta variable :
delta.x * delta.x + delta.y = delta.y

10
General / Re: sf::Texture to sf::RectangleShape
« on: December 07, 2012, 03:01:17 pm »
Read the documentation again : setTexture takes a Texture*, that is, a pointer to a texture.
So you'd need to do :

rect.setTexture(&rectTexture);

But that's not the only problem here.
First, you shouldn't load the texture every time you're drawing the tile. Rather, you should keep the texture alive somewhere else (it's easier if you use OOP with classes and all, you could put the texture as a class member).

If you want to draw a tile map, there's a better solution : VertexArray.
First, you'll need to have only one image file containing all your possible tiles. Then, you'll tell the VertexArray which part of that texture you want to use for each tile.

The VertexArray is not trivial to use, so you'll need to read the doc carefully.
Now, some people have done it before you, and you may want to make use of that : Thor is a helper library for SFML that makes many tasks easier, including tilemaps.

11
System / Re: multithreading and srand
« on: December 07, 2012, 02:15:12 pm »
rand() is not thread-safe.
http://linux.die.net/man/3/rand

Also, this doesn't really concern SFML, and is just a general C question.

Just google "rand thread safe" and you'll find plenty of information :)

12
General discussions / Re: CeGUI or sfGUI
« on: December 06, 2012, 09:10:06 pm »
CeGUI has many backends, including openGL, that SFML can use. But CeGUI doesn't use SFML directly, so you don't need SFML to use CEGUI.

CEGUI is a bigger project, but may also be a bit harder to use (damn, it's getting cliché in here).

You can probably do everything you want with any of them. I chose CeGUI, because not all of my projects use SFML, but there's no bad pick with either one.

13
General discussions / Re: Go binding for SFML
« on: December 05, 2012, 08:25:10 am »
One bug found : you renamed Rect{f,i} to {Float,Int}Rect as in SFML, but struct_test.go still uses the old version.
Added an issue at bitbucket.

Also, I created a package for Archlinux to ease installation :
https://aur.archlinux.org/packages/go-sfml2/
Just tell me if if it's a problem.

I added a temporary fix for structs_test.go.
Also, you might want to think about licensing it. If you don't really care, BSD or ZLIB licenses are a good start.

14
Graphics / Re: Optimizing a lot of sprites
« on: December 04, 2012, 07:10:58 am »
The method is transformPoint, not translatePoint :p
Also, you can use a sf::Transform directly :

sf::Vertex vertices[4];
vertices[0].texCoords = sf::Vector2f(0, 0);
vertices[1].texCoords = sf::Vector2f(0, 16);
vertices[2].texCoords = sf::Vector2f(16, 16);
vertices[3].texCoords = sf::Vector2f(16, 0);

sf::Transform m_transform;
m_transform.rotate(angle);
m_transform.move(x,y);

vertices[0].position = m_transform.transformPoint(0, 0);
vertices[0].position = m_transform.transformPoint(0, 16);
vertices[0].position = m_transform.transformPoint(16, 16);
vertices[0].position = m_transform.transformPoint(16, 0);

for(int i = 0; i < 4; i++)
     vertexarray.append(vertices[i]);

window.draw(vertexarray);
 

15
Graphics / Re: Optimizing a lot of sprites
« on: December 03, 2012, 09:31:38 pm »
OpenGL supports pushing transformation matrix ; I guess these are processed on the GPU. But for the VertexArray, you can't do that, and must just transform the positions (sf::Transform has a transformPoint method ;) ) individually before adding them.

Pages: [1] 2 3 ... 5
anything