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

Pages: [1]
1
Graphics / Re: creating a texture through code
« on: January 14, 2021, 01:12:03 pm »
Does your map change each frame? Then you probably should create an sf::Image from the pixels and dump it to disk. You can then draw player and other things in a separate pixel array each frame and overlay it on top of the minimap.
Or at least move the map drawing code into a startup function so that it doesn't run each frame :)

2
Graphics / Re: creating a texture through code
« on: January 13, 2021, 02:16:49 pm »
sf::Image is in many ways just a pixel buffer, so use that to update the texture as Laurent says.

A sf::Texture is just a sf::Image that lives on the graphics card.

3
General / Re: Visual Studio 2019 16.8.3
« on: January 10, 2021, 04:56:05 pm »
You can also use vcpkg and install SFML from source without any pain.
Since it is a Microsoft thing it integrates really well with Visual Studio.
Just run the following in a command prompt from your project directory:
git clone https://github.com/microsoft/vcpkg
Code: [Select]
cd .\vcpkg\
.\bootstrap-vcpkg.bat
.\vcpkg.exe install sfml
Or .\vcpkg.exe install sfml --triplet x64-windows-static if you want a static build.

By the way: hi Kojack, long time, no see :)

4
General / Re: Abandoned SFML because of the install process
« on: January 10, 2021, 04:37:03 pm »
There actually is an option that you overlooked: vcpkg.
Since vcpkg is a Microsoft thing it integrates seamlessly with Visual Studio.
To get SFML you simply use vcpkg to fetch and compile the whole thing.
You don't have to deal with CMake at all :)

https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=msvc-160

What I did to get SFML was to run the following commands in the terminal/prompt (from the project directory):

Code: [Select]
git clone https://github.com/microsoft/vcpkg
cd .\vcpkg\
.\bootstrap-vcpkg.bat
.\vcpkg.exe install sfml --triplet x64-windows-static
I chose a static x64 build, but you can obviously choose to install  the default by omitting the triplet argument.
Make sure you install the Visual Studio vcpkg integration, and you are going to have your SFML cake and eat it too.

Pages: [1]
anything