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.


Topics - Elro444

Pages: [1]
1
General discussions / sf::RenderWindow::getMouseCursorVisible() ?
« on: March 21, 2018, 07:47:46 pm »
Hi,
Is there any way in SFML to determine the current state of sf::RenderWindow's "settings"?
By "settings" I mean all the functions like setMouseCursorVisible(), setMouseCursorGrabbed(), setVerticalSyncEnabled() and so on.

I have a function that gets a sf::RenderWindow, and calls some of these functions, and I would like my function to be able to 'clean up' after itself, so that the window will return to it's original state after the function returns.

2
Graphics / Off Screen Rendering Antialiasing
« on: October 13, 2017, 04:13:37 pm »
I am working on a small Top-down perspective game, where there is a 'vision' system, with shadows hiding stuff the player souldn't be able to see (like behind walls, or behind his back).
I use a sf::RenderTexture as a canvas, where i manage all the shadows for a player's screen(ConvexShapes drawn to it, then i convert it to an sf::Image, to use the createMaskFromColor function, to eliminate the non-shadow background. It will matter mostly for multiplayer, where i want to create a 'shared' vision for the entire team).
My problem is that when i draw my RenderTexture to the game window (sf::RenderWindow) it's pixelated. I'm new to SFML, and quite new to graphics in general, so if what I'm looking for is not antialiasing please forgive me.
Also,
I looked around a little and checked on the forum for this, and I saw that binary1248 said that RenderTexture "wastes a considerable amount of GPU resources both in terms of processing time and memory usage." (on this post: https://en.sfml-dev.org/forums/index.php?topic=22147.0 )
So is it really that bad to use RenderTexture?
If so, what should i use for off-screen rendering? (I saw the potential use of views, but I still can't see a way of replacing the Image::createMaskFromColor)
Is there any other way to supposingly 'erase' something drawn? (right now i am redrawing white to the temporary canvas, and then i set the alpha of white to 0, as mentioned above, to erase shadows before i draw them)
And last, if RenderTexture is still what i need to use, how do I make the shadows drawn from the RenderTexture smoother?
Sorry for the long post  ;D

Pages: [1]