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

Pages: [1]
1
General / Static linking problem with VS2019
« on: August 29, 2019, 05:14:36 pm »
Hi. I'm trying to static link prebuilt binaries using Visual Studio 2019 and it fails with undefined references type of LNK2019. It works with dynamic link (no "s" suffix) and the app runs okay with dlls provided.
The command I'm trying to build with is:
cl -EHsc main.cpp sfml-graphics-s.lib sfml-window-s.lib sfml-system-s.lib opengl32.lib freetype.lib winmm.lib gdi32.lib
This command is for building your example green circle.
Am I wrong in linkage order? It fails on linking the graphics package. Same command previously worked with MinGW's g++, of course with proper substitutions.

(click to show/hide)

UPD: -DSFML_STATIC makes no effect (even longer list of link fails)

2
General / Threaading a sprite
« on: February 04, 2019, 06:01:04 pm »
Hi. I've got a sf::Sprite inheritor and I want to make it perform attack animation. The problem is that the duration of that animation must be much longer than a quick button click.
I made "attack" method as a thread that locks other methods from changing sprite's position and texture.
But that texture doesn't seem to change. When R key is pressed, strikev2() is called.
(click to show/hide)
So in performAttack I exactly want my texture to change 4 times and it doesn't happen but locked makes the effect and std::cout also prints integers. I think the problem is syncing texture in main. Could you, please, suggest how should I fix that?

3
Hi, community.
I love this library for almost everyting excpet one thing - there are only default (excluding copy) constructors for texture and image class.
It puts me in some trouble because I would like some static const textures and images (then they are read-only, it's safer for multi-threading). I actually think this will add some efficiency, please, tell me if I'm wrong.
So I can't make textures const as I have to use loadFrom...() method instead of direct initialization in class constructor.
I think there are reasons for those not to exist yet. Could you, please, tell me them? :)

Pages: [1]