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 - Me-Myself-And-I

Pages: [1] 2 3 ... 7
1
Thankyou so much! :D This is just what i've been looking for.
btw the function DragQueryFile didn't work for me with the third parameter being wstring. I changed it to char fPath(MAX_PATH); and that worked. I don't know if thats better or worse but I just thought i'd mention the aforementioned wstring didn't work for me. Thanks again for your help. ;D

2
Hello. I'm trying to implement dragndrop files functionality into my sf::window for windows 11 using the window handle and WINAPI. So far I have this but it doesn't do anything. The window shows it allows dragndrop but it doesn't receive any path to the dropped files.

int main(int argc,char* argv[])
{
       
               
       
       
        IntRect workarea;
        workarea=getWorkArea();
        RenderWindow window(VideoMode(workarea.width,workarea.height),"Desk Engine",Style::None);
        window.setPosition(Vector2i(0,0));     
       
        //Set SFML to allow dragNdrop and hide from taskbar.
        WindowHandle handle = window.getSystemHandle();
        SetWindowLongPtrA(handle,GWL_EXSTYLE,WS_EX_ACCEPTFILES|WS_EX_TOOLWINDOW);

        DragAcceptFiles(handle, TRUE);
       
        while(window.isOpen())
        {
               
                Event e;
                while(window.pollEvent(e))
                {
                        if(e.type==Event::Closed)
                                window.close();
                }
               
                //Handle DRAG and DROP
                MSG msg;
        while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            if (msg.message == WM_DROPFILES)
            {
                HDROP hDrop = (HDROP)msg.wParam;
                char filePath[MAX_PATH];
                DragQueryFileA(hDrop, 0, filePath, MAX_PATH);
                DragFinish(hDrop);
                cout << filePath << endl;
            }
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
       
        //render stuff
}
 
Thanks in advance!

3
Audio / Re: Music.setVolume doesn't work.
« on: August 30, 2024, 12:59:24 am »
There was a line of code somewhere accidentally being run in a loop and setting the volume to 100. Thanks for the help.  :D

4
Audio / Re: Music.setVolume doesn't work.
« on: August 28, 2024, 11:02:20 pm »
I mean it doesn't change the volume at all. Its still at 100% volume.

5
Audio / Music.setVolume doesn't work.(SOLVED)
« on: August 28, 2024, 09:31:56 pm »
For some unknown reason sf::music.setVolume() does not work at all. I'm sure its being called since It printed a test word to the console from the line of code directly before the function.
I saw that someone else had this problem here https://en.sfml-dev.org/forums/index.php?topic=20657.0 so I tried updating to the latest SFML with GCC 13. It still doesn't change the volume when it should. I have made this minimal example.

The following code gets run in the main loop after the music has been set.


cout<<"test"<<endl;
music.setVolume(0);

 

I'm guessing its either a problem with how I linked up SFML or a problem with SFML itself.

6
General / Re: Trouble building SFML from source.
« on: August 28, 2024, 12:23:45 am »
I don't understand. Shouldn't the latest SFML be able to be compiled from source using the latest GCC compiler? I am using GCC 14.2.0 and SFML 2.6.1.

EDIT:

Nevermind. I got the latest SFML binary to work with GCC 13 instead. I'm just gonna give up on building SFML from source. Thanks for the help anyways. :)

7
General / Re: Trouble building SFML from source.
« on: August 27, 2024, 02:28:03 am »
Well now I'm having another problem. ???

[100%] Linking CXX shared library ..\..\..\lib\sfml-audio-2.dll
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Humor/Downloads/SFML-2.6.1-sources/SFML-2.6.1/extlibs/libs-mingw/x86/libFLAC.a(stream_decoder.o):stream_decoder.c:(.text+0xfd): undefined reference to `_imp___iob'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Humor/Downloads/SFML-2.6.1-sources/SFML-2.6.1/extlibs/libs-mingw/x86/libFLAC.a(stream_decoder.o):stream_decoder.c:(.text+0x144): undefined reference to `_imp___iob'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Humor/Downloads/SFML-2.6.1-sources/SFML-2.6.1/extlibs/libs-mingw/x86/libFLAC.a(stream_decoder.o):stream_decoder.c:(.text+0x184): undefined reference to `_imp___iob'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Humor/Downloads/SFML-2.6.1-sources/SFML-2.6.1/extlibs/libs-mingw/x86/libFLAC.a(stream_decoder.o):stream_decoder.c:(.text+0x400): undefined reference to `_imp___iob'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Humor/Downloads/SFML-2.6.1-sources/SFML-2.6.1/extlibs/libs-mingw/x86/libFLAC.a(stream_decoder.o):stream_decoder.c:(.text+0x4db1): undefined reference to `_imp___iob'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Humor/Downloads/SFML-2.6.1-sources/SFML-2.6.1/extlibs/libs-mingw/x86/libFLAC.a(stream_decoder.o):stream_decoder.c:(.text+0x5064): more undefined references to `_imp___iob' follow
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [src\SFML\Audio\CMakeFiles\sfml-audio.dir\build.make:453: lib/sfml-audio-2.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:333: src/SFML/Audio/CMakeFiles/sfml-audio.dir/all] Error 2
mingw32-make: *** [makefile:155: all] Error 2

8
General / Re: Trouble building SFML from source.
« on: August 27, 2024, 02:02:23 am »
I used the compiler you showed and made sure the bin folder was in the environment variables but it still gives the exact same error.

[  0%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj
C__~1.EXE: error: unrecognized command line option '-Wnull-dereference'
C__~1.EXE: error: unrecognized command line option '-Wmisleading-indentation'
C__~1.EXE: error: unrecognized command line option '-Wduplicated-cond'
mingw32-make[2]: *** [src\SFML\System\CMakeFiles\sfml-system.dir\build.make:76: src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:202: src/SFML/System/CMakeFiles/sfml-system.dir/all] Error 2
mingw32-make: *** [makefile:155: all] Error 2


EDIT:

Nevermind. That fixed it after I set cmake to use that compiler instead of the other.  Thanks a lot! :D

9
General / Re: Trouble building SFML from source.
« on: August 27, 2024, 01:51:01 am »
Yes,I was using a old compiler. I'll try using that then.

10
General / Trouble building SFML from source.
« on: August 26, 2024, 07:37:00 pm »
Hello. I tried building SFML from source and ran into some errors. After generating the mingw makefile using cmake I tried building the library using "mingw32-make install".

[  0%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj
C__~1.EXE: error: unrecognized command line option '-Wnull-dereference'
C__~1.EXE: error: unrecognized command line option '-Wmisleading-indentation'
C__~1.EXE: error: unrecognized command line option '-Wduplicated-cond'

Help would be greatly appreciated. :)

11
Yes. It returns the value that says its failing but it still seems to work right for my computer. :P So...I don't know what's wrong with it.

12
Oh, I have windows 11 but I want to make this compatible with windows 7 for several specific users that don't want to switch to anything newer.  I guess you don't know any answer for this.  Thanks anyways.

13
Code: [Select]
result=SetWindowLongPtrA(handle,GWL_EXSTYLE,WS_EX_LAYERED|WS_EX_TOOLWINDOW);

if(result==0)
{
MessageBox(handle,"Error","Error",MB_OK);
}

SetWindowPos(handle,HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);


SetLayeredWindowAttributes(handle,RGB(255,0,255),0,LWA_COLORKEY);


Any ideas why this doesn't work on windows 7? The winapi documentation said something about "The SetWindowLongPtr function fails if the process that owns the window specified by the hWnd parameter is at a higher process privilege in the UIPI hierarchy than the process the calling thread resides in." Could this be a possible reason for not allowing transparency?

14
General discussions / Re: Ko-fi
« on: August 17, 2024, 05:13:27 pm »
I can't believe i've never heard of ko-fi before. :o

15
General / Re: How to include SFML for building SFGUI in cmake?
« on: August 17, 2024, 05:03:52 pm »
Sorry for taking so long to reply. Is the SFML source code required or can this be done with a binary? Looking in the binary lib folder I can't find any .cmake file or a cmake folder or a SFML folder in that directory.

Pages: [1] 2 3 ... 7