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

Pages: 1 ... 4 5 [6] 7 8 ... 123
76
General / Re: Making a game playble on other computers
« on: January 17, 2019, 01:29:51 am »
https://stackoverflow.com/questions/5101458/why-is-a-bad-practice-to-distribute-the-debug-version-of-the-application-in-net

Specific dlls and where to find them (other than anything you use like SFML dlls) depend on your specific compiler. With certain compilers and/or compiler setting there might be nothing (that's often called 'fully statically linked standalone executable' or similar and depends only on built in stuff in C:/Windows/). You need to be careful not to include wrong ones, like wrong architecture (32 bit vs 64 bit) and so on. Many commercial games made in VS include an installer of VS redistributable runtime instead and run it at first launch or something.

You can pack your files into zip or 7z or something and then load them using some library like PhysicsFS (be sure to get latest version from Mercurical, latest stable version is badly busted, you need to buil dit yourself either way). PhysicsFS is meant for this (gamedev) purpose and support many formats (but it's best to stick to zip or 7z).

This is only zipping up into a single file, if you want encryption you need something else (zip encryption works with PhysicsFS but is very bad/tedious to use in your code). Any encryption (even proper AES) you do will be eventually be broken by a determined hacker who finds where the key is in the exe or game files though (even commercial real games get pirated and DRM broken all the time) so you might just not bother or go with just a xor with some hardcoded key (this is horrible and unsecure encryption but it's easy and quick to do and you're just trying to demotivate the most common attacker anyway) and set it to all 0s during development to work on plain files and use 7z instead of zip and a different extension than .7z to try confuse/demotivate most people (just changing the extension without any encryption/scrambling of the contents will only makes the simplest hacker go away).

If you want to embed files into the exe there are a few way too. There are OS specific ways to do it (I know nothing about them), there is embedding them in the code as const char[] = { data-here } (there are tools to generate these files or you can write one yourself, it's like 20-30 lines of code) or another funny/easy way is to concatenate an archive onto an exe and then open it in the right way in your program. Or you can just not bother with it and have: your exe, your dlls, an archive file or few, and maybe some config and a save directory. That's not that much stuff to have (the archiving of all your game resources into a single file is your biggest win for decluttering and performance).

77
Feature requests / Add a way to get sf::Text vertices
« on: January 16, 2019, 06:02:16 pm »
I've mentioned it in pain points thread already. It'd let someone play with them on their own, like cache a few texts and pretransform them, or put them in a VertexBuffer. Just a simple getVertexCount + getVertexPointer, just like Image now has?

78
General discussions / Re: What pain points do you experience using SFML?
« on: January 15, 2019, 10:24:02 pm »
I wanted normalized coords too (and someone did in 2012). https://en.sfml-dev.org/forums/index.php?topic=17099 :-X

Text rendering slowness is interesting. I wonder if VertexBuffers would help there. You could even do that caching yourself in a few lines if SFML let you take out the vertices out of a Text after they were built.

Sprite batching and resource managers is kinda specific and there would be very opinionated choices. Camera too. I'm not even sure what you mean by Camera. Any specific framework that has a Camera as you'd like it?

PhysicsFS is a better virtual filesystem than SFML could ever be, there is no point in reinventing the wheel or wrapping it up in some 1:1 way that leaves out some 'too niche' functionality. Kinda same with libcurl. I don't even think of Network part of SFML, like ever. It's all Windows/Graphics + Audio to me. :P

In general if something is easy to do yourself, would have an opinionated design or there is already a superb library for it - I don't want it in SFML. Partly out of fear there would be weird choices I'd dislike.

79
General / Re: Making a game playble on other computers
« on: January 15, 2019, 09:18:33 pm »
If you include all the needed dlls and your game files then you can just zip it up and give it to someone. If you really want to make an installer (why?) you can use Inno Setup, Nullsof Scriptable Install System or some other 'installer maker'.

80
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 05:03:21 pm »
Builds of what? Extlibs? Because the extlibs are the problem here. CMake files we give are supposed to support 3 last version of VS?

I'm still mind blown this happens to work right now (flawlessly since VS 2015!!!) because sprintf is used once in a function we never use...

And the fact this prevents us from just defining STB_IMAGE_WRITE_STATIC...

We can define STB_IMAGE_STATIC no problem though!

81
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 12:55:30 pm »
I have no idea. This is pretty WTF. Like I know there is a warning/error when using these 'unsafe' functions but this is a whole new level of WTF. ;D And the fact this one unused function in image write was saving us...

Quote
Soon we can drop the non MSVC universal libs, once VS 2019 comes out.
Oh, why? And what's the difference between stuff in libs-msvc-universal and libs-msvc?

82
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 11:43:26 am »
Defining STB_IMAGE_WRITE_STATIC causes dynamic SFML Graphics to fail to build with "LNK2019   unresolved external symbol _sprintf referenced in function __bdf_parse_properties   sfml-graphics   D:\sources\SFML\src\SFML\Graphics\freetype.lib(bdf.obj)".

Static SFML Graphics builds but then fails with same error unless  you use sprintf in your code.

So bdf.obj needs that, and unless some user code (or our stbi_image_write) pulls it in by calling it somewhere it fails to link. ???

It fails with this define because only function in stbi_image_write that calls sprintf is stbi_write_hdr_core which never gets called by SFML or any functions it calls so it gets stripped from the .obj by the compiler.

This is correct and adding legacy_stdio_definitions.lib to linker in either cases removes the _sprintf missing error: https://stackoverflow.com/questions/32418766/c-unresolved-external-symbol-sprintf-and-sscanf-in-visual-studio-2015

My brain right now...

83
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 10:18:31 am »
Jesus. Yes. :P



And I didn't need to try to know it'd happen (but I tried it yesterday just to be sure). I just thought of this problem again when I thought that right now the only way to save png to memory is to use stb_image_write (or something else) yourself.

Actually it's kinda ironic that it's SFML that misses this save-to-memory functionality, thus forcing you to use stb_image_write yourself but then it turns out SFML in static linking prevents you from doing that...

84
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 10:00:26 am »
It is broken. Linking SMFL statically + using STB in your own code without those macros on your side = linking errors. A lot of "LNK2005   _stbi_load_from_memory already defined in main.obj" will happen (for various functions). SFML's internal details shouldn't force a user to do that. Especially if we can fix it in two lines that'll also make the compiled code smaller and/or faster. It's like a smaller scale version of when static SFML linked its deps statically.

Oh, you also get one "LNK1169 one or more multiply defined symbols found". :P

85
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 09:50:09 am »
Those warning that might appear are the only downside. Let's see what Laurent says.

86
Feature requests / Re: Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 15, 2019, 07:35:03 am »
I'm not sure what the ;) was for, are you agreeing or not? Reason as to why not would be if more files included those two headers but they don't (unless I missed something) so it's not an issue at all.

And to make it clear, I mean #define in the code of ImageLoader.cpp before including those two headers, not in any build/project settings.

Oh, and wouldn't it produce "unused static function" errors in some cases? It still should be done though.

On the other hand this might make this part of code marginally faster and the built SFML a bit smaller if unused functions get stripped out, not that it matters for these parts of code.

87
Feature requests / Define STB_IMAGE_STATIC and STB_IMAGE_WRITE_STATIC
« on: January 14, 2019, 04:15:36 pm »
We should define those two macros in ImageLoader.cpp so that a statically linked SFML doesn't collide and cause tons of linking errors when the user's program also includes their own STB without defining those macros (they make all stb functions static).

Yes, I know I'm inventing random niche problems daily.

88
Feature requests / Re: Image saving
« on: January 14, 2019, 10:40:46 am »
Time to design an output stream then?

89
Feature requests / Re: Should VertexBuffer fallback to VertexArray?
« on: January 14, 2019, 10:39:39 am »
Yeah, but shaders have no real fallback, it's not we can compile GLSL to a bytecode somehow ourselves. That'd be crazy. I guess it's fair enough to tell users to do it since it's a special feature so anyone caught by it is past the level of Sprites and Textures.

90
Feature requests / Re: Should VertexBuffer fallback to VertexArray?
« on: January 13, 2019, 01:15:53 pm »
Well I can. But is every SFML user gonna get that or is their game gonna get bricked and show almost nothing if extension loading fails? :P

Pages: 1 ... 4 5 [6] 7 8 ... 123
anything