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

Pages: [1]
1
Audio / OpenAL DLL in the executable
« on: December 15, 2017, 08:25:37 am »
I wanna have everything for my small game in a single .exe.
I can include the resources and statically link the libraries, ok. But for the audio part, this leaves me with an openall32.dll outside.
I believe I'm allowed to add it too if I follow the "About" approach mentioned here.

How should I do it? Can I somehow statically link it, have SFML detect it from embedded resources or do something else?

2
Audio / Seamless transition for a looping section
« on: October 11, 2017, 01:34:34 pm »
Using VS2015, C++, SFML 2.4.1, sf::Music class.
I have a .ogg music file with an intro-body-outro structure. I play its intro once, then loop the body indefinitely.

I achieved this by adding
if (my_music.getPlayingOffset().asMilliseconds() > end_of_body)
my_music.setPlayingOffset(sf::milliseconds(beginning_of_body);
inside of
while(my_render_window.isOpen())

However, when the transition occurs, the song hiccups. What should I do there to make it seamless?

3
Graphics / Casting integers for setPosition() properly
« on: April 12, 2017, 04:35:57 am »
Using SFML 2.4.1, C++11. Basic question.
I want to position a sprite using integer variables.

Given
int x = 120, y = 300;
sf::Sprite my_sprite;
, should I do
my_sprite.setPosition(static_cast<float>(x), static_cast<float>(y));
or
my_sprite.setPosition(sf::Vector2f(sf::Vector2i(x, y)));
or another way?

And why should I do it that way?

4
General / Rendering some Sprites once while re-rendering others
« on: January 18, 2017, 05:57:50 am »
My program maps and draws a huge grid of sf::Sprites for the background. Some of them are just static and some are animated. I want to draw the static ones only once and then keep redrawing only the animated ones.
However, sf::RenderWindow.clear() wipes the whole window.
How can I separate both processes so I don't touch the static ones?

5
General / Can't build a static-library project for Windows XP
« on: January 01, 2017, 02:14:47 am »
I want to create a C++/SFML game that runs in Windows XP and doesn't ask the user for MSVCP140.dll.

I'm using SFML 2.4.1 for Windows (Visual C++ 14 (2015) - 32-bit) with Microsoft Visual Studio Community 2015.
I'm working in Windows 10 and using Windows XP in a virtual machine to test this.
I tried to ship whatever it needs with the program, but at some point it asks for something that isn't a file.
Then I believe I have to make it a static-library project.
So I followed the tutorial for SFML 2.4 and Visual Studio.

Reproducing my steps adapted to the case:

I open Visual Studio > New Project > C++ (.NET Framework 4.5.2) > Win32 Console Application > name it "test" > check "Empty project" > click Finish
Create a "main.cpp" inside "Source Files" branch
Put "SFML-2.4.1" folder into "C:\"
Open the Property window for my project
Set Configuration to "All Configurations"
General > Platform Toolset > Visual Studio 2015 - Windows XP (v140_xp)
C/C++ > General > Additional Include Directiories > "C:\SFML-2.4.1\include"
Linker > General > Additional Library Directiories > "C:\SFML-2.4.1\lib"
Set Configuration to "Debug"
C/C++ > Preprocessor > Preprocessor Definitions > prepend "SFML_STATIC;"
C/C++ > Code Generation > Runtime Library > Multi-threaded Debug (/MTd)
Linker > Input > Additional Dependencies > prepend "sfml-graphics-s-d.lib;sfml-window-s-d.lib;sfml-system-s-d.lib;"
Set Configuration to "Release"
C/C++ > Preprocessor > Preprocessor Definitions > prepend "SFML_STATIC;"
C/C++ > Code Generation > Runtime Library > Multi-threaded (/MT)
Linker > Input > Additional Dependencies > prepend "sfml-graphics-s.lib;sfml-window-s.lib;sfml-system-s.lib;"
Then I go back to the project, copy the code from the tutorial to "main.cpp" and try to run Build Solution.

Debug (x86): 171 Errors and 87 Warnings
First error: LNK2038 mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in main.obj
Release (x86): 105 Errors and 1 Warning
First error: LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in main.obj

I thought I did everything needed for a static-library project, but something is still dynamic. I don't know what to do from here. Please, help?

Pages: [1]