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

Pages: [1] 2 3 ... 8
1
DotNet / Re: Poor performance using multiple VertexArray
« on: March 25, 2016, 08:42:05 am »
You don't need quad tree for tile map, because getting visible tiles is as simple as leftCorner / tileSize and rightCorner/tileSize (or in his case chunk size).
It kinda works like spatial hashing, simplest case.

2
DotNet / Re: Poor performance using multiple VertexArray
« on: March 23, 2016, 02:06:01 pm »
You should be using something like a QuadTree to find out what you should be drawing. Have a camera class, get its bounds, and use the QuadTree to query what objects are inside the camera's bounds. You should *never* have a draw loops that just iterates over every entity inside your game.

If you make the code available again (It says I don't have access to look at the repository) I can test your code with a QuadTree.

Quad tree is pointless for tile maps, and he want's to have full zoom out anyway.

3
DotNet / Re: Poor performance using multiple VertexArray
« on: March 18, 2016, 01:42:22 pm »
12fps seems reasonable when drawing 8 million triangles. You should use render targets, and probably manually implement mipmaps, since SFML doesn't support them.

4
General discussions / Re: iOS Port, news?
« on: March 12, 2016, 07:09:38 pm »
I created podspec for sfml, so it's much easier to add it to the app now:

inhibit_all_warnings!
pod 'sfml', :podspec => 'https://gist.githubusercontent.com/krzat/5653b17c6b733823dea4/raw'

Also attached example project.

5
General / swift SFML wrapper
« on: March 12, 2016, 11:22:16 am »
I wrote generator to create swift wrapper for SFML. Seems to be working, but there may be some issues related to memory management, i.e. texture will be not retained if you assign it to sprite, etc.

https://github.com/krzat/swift-sfml-wrapper
Repository contains small project for testing purposes.

6
Graphics / Re: Line artifacts when drawing tilemap
« on: August 10, 2014, 01:39:26 pm »
I fixed similiar problem by using 1 pixel margin around tiles in spritesheet. For some reason GPU was pulling pixels from outside of the texcoords.

I tried this, but it made the problem even more apparent with even larger black lines.

I forgot to add that this margin should have same colors as the tile. So if you need 40x40 tiles, you need to draw 42x42 tiles and use rectangle 1 pixels from the edges. If that won't work, you should just post working example of the problem.

7
Graphics / Re: Displaying text in center of screen
« on: July 24, 2014, 12:21:22 am »
On the screenshot it looks like the width and height values are reversed. Check their definition if the W_WIDTH is really larger than W_HEIGHT.

If you don't want to show code, just write minimal example. It would take like 5 minutes.

8
Graphics / Re: Line artifacts when drawing tilemap
« on: July 24, 2014, 12:17:52 am »
I fixed similiar problem by using 1 pixel margin around tiles in spritesheet. For some reason GPU was pulling pixels from outside of the texcoords.

9
SFML projects / Re: SFML.Utils - extensions for SFML.Net
« on: July 23, 2014, 09:26:38 pm »
Cool, nice to see someone beside me is using it.

10
DotNet / Re: Suggestion: Make all structs immutable
« on: July 13, 2014, 03:33:18 pm »
You kinda did before. Initializer syntax is not very useful for immutable struct, but you mentioned it.

11
DotNet / Re: Suggestion: Make all structs immutable
« on: July 13, 2014, 02:24:13 pm »
It won't work for immutable structs.

12
General / Re: Undefined references with MinGW 4.9.0
« on: July 13, 2014, 01:15:10 am »
You forgot -lsfml-graphics -lsfml-window -lsfml-system
g++ main.cpp -DSFML_STATIC -IC:\SFML\include -LC:\SFML\lib -lsfml-graphics -lsfml-window -lsfml-system

13
DotNet / Re: Suggestion: Make all structs immutable
« on: July 12, 2014, 10:21:26 pm »
If you really want, you can write constructor like this:
public Vector2f(float x = default(float), float y = default(float))
{
...
}
 

14
General / Re: How to "blend" two states?
« on: July 12, 2014, 08:30:54 am »
This is popular technique used for multiplayer games. I would try to separate state from the entity and have something like entity.draw(state1, state2, dT).

15
DotNet / Re: Suggestion: Make all structs immutable
« on: July 10, 2014, 11:16:38 pm »
XNA has mutable struct for a reason (despite being Microsoft's product).

These guidelines may make sense for "enterprisey" programming, where people barely use value types and may be bitten by their behaviour. IN SFML's context, they are used as simple data holders and should stay this way. I can't imagine what a hell manipulating FloatRect would be.

btw. you should benchmark your Vertex (after fixing stack overflow) to see if it really is that lightweight. Probably not.

Pages: [1] 2 3 ... 8