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

Pages: [1] 2 3 ... 623
1
General / Re: Saving Image Within A Rectangle
« on: December 07, 2019, 12:09:47 am »
capture() is deprecated, instead you should be using texture.update(window) and then texture.copyToImage().

As for your question, not that's not directly supported. You can do it by either rendering to a render texture only the part you want to save, or you could only save a section of the sf::Image (e.g. use image.copy() and then save the copied image).

2
General discussions / Re: Android x64 support
« on: December 05, 2019, 05:44:30 pm »
I still have a half finished draft for the dependency discuss, haven't found the motivation to fully finish it yet, but hope to get it done soon. :)

3
General discussions / Re: SFML ImGUI unresolved external symbols errors
« on: December 05, 2019, 09:59:40 am »
You aren't linking SFML itself.

Are you trying to link statically and haven't defined SFML_STATIC?

4
Network / Re: Player Movement Interpolation / Prediction
« on: December 05, 2019, 09:58:29 am »
You wouldn't really interpolate between packets, but you'd do a client side physics calculation and move your objects accordingly. Once the server response with a new data point, you set the correct position.

There's no "ideal logic" to this, but it all depends on your code.

Also here's an article that might be interesting to you: https://www.kinematicsoup.com/news/2017/5/30/multiplayerprediction

5
General discussions / Re: Setting Frame Limit of the project
« on: December 05, 2019, 09:54:50 am »
SFML already has such a functionality with setFramerateLimit().

You'd sleep the amount of time, that would still make your reach the desired frame time.
Say you want 60fps <=> 16.666ms, now your last frametime was 4ms, so you could in theory sleep 16-4ms = 12ms.
However, sleeping is not a precise action, so you need to consider some slack, if you really want to precise.
(If you want to go crazy, you can also measure the deviation and adjust dynamically)

6
General / Re: Static linking Linux
« on: December 05, 2019, 09:50:27 am »
The official Manjaro packages don't contain static libraries.
You'll have to rebuild SFML on your own.

Also static libraries have the suffix -s

7
Graphics / Re: What is the best way to handle interactive grid?
« on: December 04, 2019, 11:02:00 pm »
You shouldn't forget that you're dealing with a computer here, iterating some 81 rectangles will only bore your CPU. ;)

However since your grid is evenly spaced you don't actually need to iterate anything, but you can calculate within which cell the cursor is.

- Get the mouse position relative to the window
- Subtract the spacing around the grid (if there's any)
- Divide width and height by the width or height of a cell
- Round result down

Now you should end up with something like (0,0) for the top left cell, (0, 1) for the middle left cell, (2, 2) for the bottom right cell, etc.

8
Java / Re: Is JSFML still being developed?
« on: December 02, 2019, 08:33:37 pm »
Yes, as the website and this thread says, the development has stopped.

9
Graphics / Re: Assertion Failed when trying to load Texture
« on: December 02, 2019, 08:31:01 pm »
As mentioned on Discord, your LoadTexture function isn't returning anything.

// Method for loading Textures
sf::Texture SpriteLoader::LoadTexture(string name) {
    sf::Texture texture;

    if(!texture.loadFromFile(GetResourceLocation()+"/"+name)) {
        cout << "[ERROR]HE: SpriteLoader: Texture failed to load! (" << name << ")" << endl;
    }
}

Not even sure how this code is compiling for you.

10
Network / Re: Sending multiple packets simultaneously UDP
« on: December 02, 2019, 07:38:52 am »
No, but if you want to send the data at once, just pack it all into one Packet.

11
If you need a reliable protocol, then you'd be better of with TCP, otherwise you'll have to build some protocol on top of UDP yourself (or use a library) which will ACK (or similar) received messages etc

12
I'm on Win10, and I installed Debian from MS.
Do you mean, you're using the subsystem (WSL)?
No idea if this supports proper GPU access and it's also not really a setup that SFML supports.

The error basically indicates, that you don't have a proper GPU driver installed.

13
Window / Re: Sprite can't be positioned
« on: November 30, 2019, 11:25:26 am »
The issue is probably somewhere else in your code.

Can you provide a complete and minimal example that reproduces the issue?

14
Graphics / Re: Updating a Specific Sprite or View
« on: November 26, 2019, 11:45:48 pm »
For large maps, especially if they're changing rarely, you may want to use a render texture and draw the map to it whenever something changes. That way you won't be updating the map as often.

15
Window / Re: draw on different levels
« on: November 26, 2019, 08:52:30 pm »
You really just want two views.

Set the first view, then render your game world objects.
Then set the second view and render your GUI.

The GUI view should not be modified, except to account for window resizes, and thus your GUI will always remain stationary.
While at the same time, you can move around your game world view, follow the player, zoom in on the action, etc. all while the GUI stays stationary.

See also the official view tutorial or my own view tutorial from a while back.

Pages: [1] 2 3 ... 623