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

Pages: [1]
1
Graphics / Re: Native Handle of sf::RenderTexture
« on: March 16, 2017, 08:55:05 pm »
Nevermind I've found the bug.  :o You cant display a RenderTexture if its never drawn, another victim of to early runtime optimisations (there was a flag that skipped the draw Function of the RenderTexture when no logical changes occured).

2
Graphics / Re: Native Handle of sf::RenderTexture
« on: March 16, 2017, 08:21:50 pm »
const sf::Texture& getRenderTexture() { return(renderTexture.getTexture()); }
Trying to save the Texture of the sf::RenderTexture in a seperate class member results in a nativeHandle of 0

3
Graphics / Native Handle of sf::RenderTexture
« on: March 16, 2017, 03:46:54 am »
I've currently integrated the ImGui Libary into my SFML eviroment and started to draw my own custom Widgets. So far so good it works fine with normal sf::Textures using the getNativeHandle() function but when I Try to get the Handle of a RenderTexture my Widget just contains white Boxes (like when the sf::Texture got lost).
So my question is, is there any difference between accessing the OpenGL handle of a RenderTexture and the Handle of a regular sf::Texture?

Working example wit sf::Texture
draw_list->AddImage((void*)(texture.getNativeHandle()), rect.Min, rect.Max);
Only white boxes when using sf::RenderTexture
draw_list->AddImage((void*)(getRenderTexture().getNativeHandle()), rect.Min, rect.Max);

4
Graphics / Re: What happens with Sprites that are not in a Window?
« on: July 28, 2015, 05:14:12 pm »
It is more efficient to check if a sprite is inside the visible area and draw it (or not) accordingly than to draw everything.

Thx for the quick answer I'll keep this in mind when I completed the drawing function.

5
Graphics / What happens with Sprites that are not in a Window?
« on: July 28, 2015, 01:16:46 am »
Currently I'm making a 2D simulation game, during the process I asked myself what happens with a sprite that is drawn but isnt visible in a window. Is SFML smart enough to just skip the drawing process or does it take the same Time then drawing in a window? So if I draw like 2000 sprites in my game but only 50 are currently visible in the window, would it be more effective to check if they are visible or just draw them?

Pages: [1]
anything