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

Pages: [1]
1
Audio / Re: OpenAL DLL in the executable
« on: December 15, 2017, 10:32:08 pm »
Your only option is to recompile OpenAL as a static library, recompile SFML to use that static library, and adopt a license for your project that makes all this possible (LGPL or compatible -- with everything that involves).
Thanks so much for the positive answer and directions, I'll do that and give a good read on http://openal-soft.org/ and LGPL v2.
So much pain... for what benefit?
A retro game, because it's small. I want it to look like single-exe old games like Dangerous Dave (DOS) or SkiFree. Yes, it's mere artistic touch, but it's no pain at all, I love this. If it were, I'd just go with the package trick from Ludum Dare.
Out of that, I agree, it's unpractical. I prefer DLLs for everything instead, even resources because I do partial updates.

2
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?

3
Audio / Re: Seamless transition for a looping section
« on: December 11, 2017, 07:29:14 pm »
BTW I only compiled the Audio library (statically for my project) and swapped it and the new OpenAL .dll with the old ones.
The new OpenAL.dll (616 KB) had issues in WinXP, sounds were choppy. Reverted to previous (414 KB). Loop points still ok.

4
Audio / Re: Seamless transition for a looping section
« on: October 12, 2017, 02:30:33 pm »
No more hiccups?
Nope, it loops smoothly now. Thank you very much. :)

BTW I only compiled the Audio library (statically for my project) and swapped it and the new OpenAL .dll with the old ones.
Will switch everything when you guys release the stable version.

5
Audio / Re: Seamless transition for a looping section
« on: October 11, 2017, 06:46:40 pm »
Sure; did it.

my_music.setLoopPoints(sf::Music::TimeSpan(sf::milliseconds(beginning_of_body), sf::milliseconds(end_of_body - beginning_of_body)));

6
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?

7
Graphics / Re: Casting integers for setPosition() properly
« on: April 12, 2017, 09:38:45 pm »
If, after reading eXpl0it3r's advice, you still need to store as integer and convert to float for the position, I would probably use the first version (explicitly static_casting).
However, you should probably consider storing them as a sf::Vector2i to start with, which means the second version makes more sense:
sf::Vector2i position{ 120, 300 };
sf::Sprite my_sprite;
my_sprite.setPosition(sf::Vector2f(position));
That's precisely the case. I shouldn't have loose variables for positions to start with.
Thanks a lot, you made it really clear. Gotta do some code cleaning now!

8
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?

9
General / Re: Rendering some Sprites once while re-rendering others
« on: January 18, 2017, 12:51:22 pm »
How unfortunate.

10
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?

11
General / Re: Can't build a static-library project for Windows XP
« on: January 03, 2017, 05:08:07 am »
...And I did it! I followed the tut0r1al carefully, checked SFML_USE_STATIC_STD_LIBS but also unchecked BUILD_SHARED_LIBS.
I can't believe it. My game (C++14, SFML 2.4.1) is now a single .exe that runs on Windows XP or newer without the need to install any crap! It's beautiful. :'D

Thanks.

12
General / Re: Can't build a static-library project for Windows XP
« on: January 02, 2017, 07:22:14 pm »
Oops, I have to set static libraries on Visual Studio's side, not SFML's.
Yeah, gotta do that.

13
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]
anything