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 4 ... 8
16
DotNet / Re: SFML.NET Proposed Changes
« on: July 07, 2014, 09:01:22 pm »
Nevermind. I checked and setting points is only like 2x slower on VertexArray. I was expecting order of magnitude slower.

17
DotNet / Re: SFML.NET Proposed Changes
« on: July 07, 2014, 06:13:26 pm »
Note that VertexArray is slow due to P/Invoke. Maybe we should just reimplement entire thing as a subclass of List<T>.

18
You can do it like this: http://en.sfml-dev.org/forums/index.php?topic=10249.0

Though, recreating array every frame is the most universal technique, because you can have animations and whatever you want. It's also fast enough if done right.

19
SFML projects / Re: MIPS simulator
« on: June 25, 2014, 08:24:09 pm »
A bit similiar project. I ported jor1k emulator to C++.
https://bitbucket.org/krzat/cpp-or1k


It's not fully implemented, but the Linux is working. I though it would be a bit faster (its like 2x as fast as the Java Script version).

20
DotNet / Re: SFML.NET Proposed Changes
« on: June 08, 2014, 06:28:25 pm »
Thanks for the info. In this case, I would just write sw.ElapsedTicks / (float)Stopwatch.Frequency or have extension method for this.

21
DotNet / Re: SFML.NET Proposed Changes
« on: June 08, 2014, 11:18:40 am »
I have been always using watch.Elapsed.TotalSeconds. Isn't it accurate enough?

22
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 02, 2014, 03:54:54 pm »
I meant position. If RightBorderTouching returns true, you should move the ball and then change velocity.

23
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 02, 2014, 02:14:00 pm »
You forgot to move ball so it doesn't collide anymore. For example ball at {x:50 y:0} and radius 10 should be moved to {x: 50 y:10}.

24
Graphics / Re: Bug with textures from tileset
« on: February 01, 2014, 11:58:27 am »
I dont know. I never change position of my tiles. That does the viewport handle. I just update the viewport. Should I use static_cast<int> or round on the tiles coordinates?
That won't work. The simplest solution would be to shrink your source rectangles as  fallahn suggested. For Sprites you may write setTextureRect(sf::IntRect(1,1,62,62)) instead of (0,0,64,64).

25
Graphics / Re: Best method for using a texture pool?
« on: January 30, 2014, 08:32:58 pm »
OpenGL is basically single threaded so updating texture and drawing at the same time will not work.

60 fps seems kinda slow, check that your vsync is really disabled.

26
DotNet / Re: Request help with getting sound from resources
« on: January 27, 2014, 09:37:21 pm »
Can be related to this: https://github.com/SFML/SFML.Net/pull/21
A crappy workaround would be to save that stream to temporary file and pass the filename instead.

27
Graphics / Re: Expensiveness of changing texture
« on: January 25, 2014, 11:55:14 pm »
No. It means that GPU has to do extra work every time texture being drawn changes. For example this:
window.draw(sprite1);
window.draw(sprite1);
window.draw(sprite2); //GPU changes current texture
 
May be slower than this:
Previous will be faster than the following
window.draw(sprite1);
window.draw(sprite2);  //GPU changes current texture
window.draw(sprite1);  //GPU changes current texture
 
Assuming sprite2 uses different texture than sprite1.

EDIT: @zsbzsb: Good catch, thanks.

28
DotNet / Re: System.AccessViolation
« on: January 25, 2014, 06:49:17 pm »
1. Do you think it's necessary to track all SFML objects? I think that only OpenGL objects(Texture, Font, etc.) should be disposed in main thread.
2. Have you tried ConcurrentQueue<T> ? Perhaps it would be more efficient.
3. Maybe ObjectBase and ObjectBaseSafeHandle could be merged together?

29
DotNet / Re: System.AccessViolation
« on: January 20, 2014, 06:33:37 pm »
I'm interested. Fork on Github/Bitbucket would be nice.

30
Graphics / Re: GetPixel() in 2.1?
« on: January 18, 2014, 06:16:36 pm »
I see. Then you could try:
http://sfml-dev.org/documentation/2.1/classsf_1_1Texture.php#aefc19bcd95565dd2348fd4cec0facddc

But you will have to transform from sprite to texture yourself. Also, that method is pretty slow, so I recommend using it once per texture and then accesing images via map:
http://www.cplusplus.com/reference/map/map/

Pages: 1 [2] 3 4 ... 8