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

Pages: [1]
1
Window / Ignore mouse input
« on: April 23, 2017, 03:50:10 pm »
I have a window in sfml its transparent. i want to be able to click behind it (its topmost window)
is it possible to do this? i don't mind using windows.h its just a personal program.

i want to make a screen overlay for my self.


Code i use for transparent window
   
SetWindowLong(window.getSystemHandle(), GWL_STYLE, WS_POPUP | WS_VISIBLE);
DwmExtendFrameIntoClientArea(window.getSystemHandle(), &margins);

2
System / Re: Embedded image using resource
« on: March 02, 2017, 01:22:23 pm »
Quote
Is there any sneaky way too avoid the license and just force link it.
i may sound a bit stupid here.
Release your sources under the LGPL too. Or live with its restrictions. You know, licenses exist to protect people's work, and ensure that they will be used (and not misused) as their author whishes. So it's really wrong to try to "avoid the license" or "force" things as you like.

Oh okay. i will use another audio library then. 

3
System / Re: Embedded image using resource
« on: March 01, 2017, 10:00:52 pm »
I created a simple one of converters for myself.
I see you're using Visual Studio so I can presume Windows.
Therefore, feel free to use this:
http://www.mediafire.com/file/5ttatyq313bzenb/HppDataArrayFromFileBytes.exe

You can use it via command line or just drag the file you want to convert onto its icon (or shortcut) and it will do it automatically.

The final .hpp file also has extra stuff like an include guard and formatted values. Using the command line (or a switch), you can output the values in hexadecimal instead.

Note that this was built on Visual Studio 2013 so you may require the redistributables for that if you don't have them already.


I hear your pain with the hover. It killed me a couple of times ;D
Best advice I can give is since it's a resource, deal with it once and then hide it and never deal with it again! ;) (you could hide the loading of it in another file, for example).

Thank you !

4
System / Re: Embedded image using resource
« on: March 01, 2017, 09:31:06 pm »
Quote
Sorry. i meant the online converter.
Probably a size limit on upload. Try an offline tool, or write your own program (10 lines of code max).

I like the way of converting it in a array the only problem is that if i hold my cursor to long on the name
visual studio tries to preview the array what causes lag/crashes because its so long.

(over the openAL thing)
Is there any sneaky way too avoid the license and just force link it.
i may sound a bit stupid here.

5
System / Re: Embedded image using resource
« on: March 01, 2017, 01:36:50 pm »
Quote
i don't know about that LGPL license can you explain a bit more?
Some licenses impose restrictions on derivative work. A common restriction of the LGPL is to force your project to be LGPL too, if it uses the LGPL-licensed dependency statically. This restriction doesn't apply if you link it dynamically. That's why SFML links OpenAL dynamically, sothat you don't have to bother with license issues.

Quote
Some audio files just return 0 (mp3) and some .wav. i think it could be because the size is too big.
But what returns 0? Where? Your code? The online converter? Please take the time to describe the problem with details.


Sorry. i meant the online converter.

is it possible to use sound without openAL??

6
System / Re: Embedded image using resource
« on: March 01, 2017, 11:38:29 am »
Quote
Its seems to work only on a few audio files
Maybe you could describe the error more precisely. What exactly fails, and how?

Quote
but i can even use it because i need openAL for sound and i can't static link it
You can't link it statically, unless you comply with the LGPL license (ie. release your own code under a compatible license). What's the problem with dynamic linking?

My goal is to make a complete clean exe file. i don't know about that LGPL license can you explain a bit more?

Some audio files just return 0 (mp3) and some .wav. i think it could be because the size is too big.


7
System / Re: Embedded image using resource
« on: March 01, 2017, 11:26:45 am »
What kind of audio file? Have you tried other tools?

Its seems to work only on a few audio files. but i can even use it because i need openAL for sound
and i can't static link it. any tips?

8
System / Re: Embedded image using resource
« on: February 28, 2017, 09:17:24 pm »
Don't bother with OS-specific code, all you want to do is to embed a bunch of bytes into your code and interpret them as a resource file.

1. Convert your resource file to a C++ array (easy to do yourself, or use a dedicated program / website like this http://tools.garry.tv/bin2c/)

2. Paste the generated C++ array into your code

3. Load it with the loadFromMemory function
char myResource[] =
{
   /* the generated array */
};

sf::Texture texture;
texture.loadFromMemory(myResource, sizeof(myResource));

Very smart i will try that, thank you!

UPDATE

i tried it and it worked perfectly! thank you very much. but is it possible to do the same thing with audio?

( i tried to put it in the tool you send me but it just returns 0 )

9
System / Embedded image using resource
« on: February 28, 2017, 05:20:44 pm »
My last question was on how to remove the DLLs and i could just static link them or whatever its called,
it was really simple... but now i want my game textures to be stored inside the executable too
i was thinking that this would be easy. so i looked it up and you need to use resource files for that.
i tried doing it but failed a lot.

i don't now how to load in the resource. can someone program a function like

sf::texture = loadResource("MyResource");

or give me a tutorial.


this is my current code
        HRSRC resBlock = FindResource(NULL, "IDB_BITMAP1", RT_BITMAP);
                HGLOBAL myGlobal = LoadResource(NULL, resBlock);
                LPVOID firstByte = LockResource(myGlobal);
                DWORD resSize = SizeofResource(NULL, resBlock);
                sf::Image loadImg;
                sf::Sprite tmpSpr;
                sf::Texture text;
                loadImg.loadFromMemory(firstByte, resSize);
                text.loadFromImage(loadImg);


it does not work. at all.
oh and i copied it from someone else. (another post)


NOTE:
i'm using visual studio 2015
my English is horrible i know.
my last post was a bit unclear i hope this one is better.




10
System / Re: SFML With no DLLS?
« on: February 22, 2017, 07:11:00 pm »
It sounds as if you need to create an msi installer. You can use something like wix or installshield to create the installer.

Wix is probably your best bet as its free and very simple to use. If you have worked with xml you will get the hang of it in no time.

Edit: forget statically linking it bloats the exe. Just package everything in the installer


I dont care about file size or slower run time.  my programs are very small in the first place.

11
System / SFML With no DLLS?
« on: February 21, 2017, 07:34:05 pm »
When i make a small program and i want to send it to a friend or upload it i must include all the DLLs in a rar file. i just want a nice and simple .EXE file with no DLLs. (Well at least not send them)
i made a few games with Game maker studio and with that program you can
export just a single EXE file, really handy.
how do they do it?
they even pack the Textures inside the EXE.

what if someone just wants the game on their desktop. they would have to create a shortcut or put all the DLLs on their desktop. not really user friendly.

Pages: [1]
anything