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

Pages: [1]
1
General / Movement related question
« on: July 09, 2018, 10:14:55 pm »
Hi. I have a simple question related to moving player.

Casual move function looks like this:

if(sf::Keyboard::isKeyPressed(left)) player.move(-100, 0);
if(sf::Keyboard::isKeyPressed(right)) player.move(100, 0);

When you press LEFT and RIGHT key in the same time player doesn't move at all and it's good. But my problem is that I want it to stay stopped when I release keys in the same time, but it's not. I know that it's related to the fact the it's hard to release to keys in the same time, but I want to know the method to ease it.

2
Graphics / Re: Drawing array of vertices - efficiency
« on: July 01, 2018, 10:59:19 pm »
Thanks. :D

3
Graphics / Re: Drawing array of vertices - efficiency
« on: July 01, 2018, 02:39:38 pm »
In my case all vertices have same movement. So I'll use transform method. But I am interested in using sf::VertexBuffer. Could you give some examples of using it?

4
Graphics / Drawing array of vertices - efficiency
« on: July 01, 2018, 02:39:33 am »
Hi. I'm curious about efficiency related to drawing process. Let's say that we have a vertex array full of rectangles and we want to draw it at certain position. There are two ways to do it:

First: We can fill vertex array with properly positioned vertices and then draw it.

Second: We can fill vertex array with vertices relative to point (0, 0) and then we can apply transform to render states. (Transform may be applied at the very beginning, not in every draw call.)

Is it any difference in efficiency in this situation? What is better solution?

5
Graphics / Re: VertexArray merged with culling
« on: June 20, 2018, 12:01:40 pm »
Thank you for you response.  :D

6
Graphics / VertexArray merged with culling
« on: June 20, 2018, 11:04:27 am »
Hi guys, I have a question related to drawing objects in sf::RenderWindow. As far as I know, calling single draw of sf::VertexArray is faster than calling multiple draws. That is why I decided to implement code able to draw tilemap stored in this container. Furthermore, I have read about culling, which is simple way to omit drawing objects situated outside of sf::View. There is no way to draw only part of sf::VertexArray, so implementation of culling is more complicated. I realized that I can split my tilemap into chunks and put sf::VertexArray into all of them. This solution seems to reduce number of draw calls and number of drawn objects, but I am not convinced enough. Is there any better way to merge culling with sf::VertexArray? I am looking forward your answers.

Pages: [1]