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

Pages: [1]
1
Window / Recommended way to change mouse cursor
« on: March 31, 2020, 04:18:00 pm »
Hello,

This is just a quick question about changing the mouse cursor image for different events, "Move, Click, etc".
What is the recommended way to do this ?
1) Create new sf::Cursors for each event ?
2) Use a sprite ?
3) Is there a way I am missing ?

Regards.

2
General / Real time events vs Polling Events using a joypad
« on: July 08, 2017, 01:56:06 pm »
Whats the proper use of these events regarding joypad input for example ?

3
General / CPU usage 100% help
« on: June 03, 2017, 05:24:02 pm »
Quick question
Why is my cpu usage at 100% when I enable vsync ?
If I used window.setFramerateLimit(60) this is not the case and the cpu usage is relatively low

My graphics card is a nvidia gtx970.
Thanks

Code: [Select]
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
window.setVerticalSyncEnabled(true);

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event)){
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.display();
}
return 0;
}

4
General / Query about handling input across many classes
« on: January 26, 2017, 01:57:33 am »
Just wondering what is the correct way to handle input across many classes. Example title scene, game scene.
Should each scene have sf::event or is there a preferred way for going about this.

Thanks

5
General / Setting up shader problems
« on: October 29, 2016, 11:45:20 pm »
Just looking over the asset SFML manager on Git and wondering the following.

// Loads Shader into a map
m_shaders.load(Shaders::Shockwave, "../resources/shader/shockwave.vert", "../resources/shader/shockwave.frag");

// x = shader in the map
sf::Shader &x = m_shaders.get(Shaders::Shockwave);

If I had a shader created in my .h file how do I go about adding the shader stored in my map to the shader I created ?

Or is it better to ignore an assest manager for shaders and just loadFromFile ?

6
General / Screen wrap with views
« on: October 29, 2016, 12:42:13 pm »
I am looking for advice to approach this problem.

The game will be 4 screens across.
The view will be 1 screen in size.
My player will always be in the centre of the screen.
When the player centre x point > 4th screen centre you should see the 1st screen again.

Thanks in advance

7
General / Query about data structure for stateManager
« on: October 14, 2016, 11:42:20 pm »
Just inquiring what would be considered a good data structure to use for a manager of states ?

8
Network / Issue with UDP
« on: October 07, 2016, 06:16:37 pm »
Why does my Client connect to the Server sometimes and other times it doesn't ?
It seems a bit random to be honest.

Is there anything I can do to try maximize the success rate ?

9
General / Quick Question about objects and tiles
« on: October 04, 2016, 08:26:52 pm »
Is it better to have a tile ref/point to an object or use and ID and loop through the vector of objects and decide which object were talking about ?

Also what if we have multiple objects on the same tile ?

10
General / Just a quick query is all.
« on: September 24, 2016, 01:28:25 pm »
I was just wondering about general things from the code below is anyone can help.

#1 Does calling process"Polling Events" matter that its only updated 60 times a second ?
#2 Is it a waste to render as fast as possible ?

Thanks

// This code is from https://github.com/SFML/SFML-Game-Development-Book
void Game::run()
{
        sf::Clock clock;
        sf::Time timeSinceLastUpdate = sf::Time::Zero;
        while (mWindow.isOpen())
        {
                sf::Time elapsedTime = clock.restart();
                timeSinceLastUpdate += elapsedTime;
                while (timeSinceLastUpdate > TimePerFrame)
                {
                        timeSinceLastUpdate -= TimePerFrame;

                        processEvents();
                        update(TimePerFrame);
                }

                updateStatistics(elapsedTime);
                render();
        }
}
 

11
Graphics / Loking for a better solution for swapping pixel colors
« on: April 10, 2016, 10:51:37 pm »
Basically what I am at, is trying to change certain colors of a sprite to other colors. "Palette Swap kind of"

I can do it by changing the images pixels and tex.update(image), sprite.setTex(tex)
Is there an easier option to do this ?

Would using opengl help and can I still use sprite instead of a quad ?

Thanks in advance.

12
General / Need help/advice on analog stick on joysticks
« on: September 25, 2015, 02:46:15 pm »
First time trying to add joystick support and having a few problems.

#1 Analog sticks don't reset back to 0,0.
#2 How do you get angles from -100 to 100.

Any advice how one would go about setting deadzones etc would be grateful.

Thanks in advance.

Pages: [1]
anything