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

Pages: [1] 2
1
General / Re: Unable to use RSFML
« on: June 19, 2021, 03:59:06 pm »
Um sorry I'm late a lot has been happening but I seem to be getting this error after I add set(SMFL_DIR "<SFML_SRC_DIR>")

Quote
CMake Error at D:/msys64/mingw64/lib/cmake/SFML/SFMLConfig.cmake:139 (message):
  SFML found but some of its dependencies are missing ( FreeType OpenAL
  VorbisFile VorbisEnc Vorbis Ogg FLAC)
Call Stack (most recent call first):
  src/SFML/CMakeLists.txt:25 (find_package)


CMake Error at src/SFML/CMakeLists.txt:25 (find_package):
  Found package configuration file:

    D:/msys64/mingw64/lib/cmake/SFML/SFMLConfig.cmake

  but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
  FOUND.


-- Configuring incomplete, errors occurred!

I really don't understand CMake

it seems to have found SFML but SFML_FOUND is set to false
but I went through the entire CMakeLists.txt file but I found no SMFL_FOUND anywhere

2
Is there any way to fix it?

3
I was trying out MAGIX and after getting bored I left it open in the background then went and started testing my project which was supposed to play some audio but it started printing out this error

Quote
AL lib: (EE) ALCmmdevPlayback_resetProxy: Failed to initialize audio client: 0x8889000a
Failed to create the audio context

and after I closed MAGIX...
It started playing it properly so is this a bug or is there some way I can fix this? :-[

also, it works fine with other apps like chrome and windows media player

4
General / Re: Unable to use RSFML
« on: June 03, 2021, 02:38:39 pm »
I can't seem to find the FindSFML.cmake file...
or do I have to make it myself?

if so how do I do that,
I am inexperienced in CMake.

5
General / Unable to use RSFML
« on: June 01, 2021, 03:17:57 pm »
I try compiling but it keeps giving me this linker error.

Quote
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-Wl,--di
sable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_6
4-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Users\\shale\\.rustup\\to
olchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "D:\\tmp\\source\\rs\\ri
mg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.0.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\tar
get\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.1.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\de
bug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.10.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\d
eps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.11.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\r
img-ad2a4556e79d2940.rimg.20lb8wv2-cgu.12.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad
2a4556e79d2940.rimg.20lb8wv2-cgu.13.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556
e79d2940.rimg.20lb8wv2-cgu.14.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d29
40.rimg.20lb8wv2-cgu.15.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rim
g.20lb8wv2-cgu.2.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8
wv2-cgu.3.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu
.4.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.5.rcgu
.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.6.rcgu.o" "D:
\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.7.rcgu.o" "D:\\tmp\\
source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.8.rcgu.o" "D:\\tmp\\source\
\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.9.rcgu.o" "-o" "D:\\tmp\\source\\r
s\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.exe" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\
rimg-ad2a4556e79d2940.4yd7dkx4mepq9kek.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\\tmp\\source\
\rs\\rimg\\target\\debug\\deps" "-L" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\
\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\
\libsfml-b9afb2dd96dce8b0.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libbitflags-84f5a0c0a040c
b29.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libonce_cell-50563e1b480243e9.rlib" "D:\\tmp\\s
ource\\rs\\rimg\\target\\debug\\deps\\libwidestring-5382785c179206ec.rlib" "D:\\tmp\\source\\rs\\rimg\\tar
get\\debug\\deps\\libcsfml_graphics_sys-2e5f9fc9ee526da7.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\
deps\\libcsfml_window_sys-9bfd16c96170dff1.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libcsfml
_audio_sys-be74682fdca4ff3a.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libcsfml_system_sys-c21
ace4f867a3dbe.rlib" "-Wl,--start-group" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-g
nu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-5c720e8db4b99e37.rlib" "C:\\Users\\shale\\.rustup\\to
olchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-29283164
da786e03.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-
pc-windows-gnu\\lib\\libobject-1776be3a32adbb49.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_6
4-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-0892c1b32ffa2c4d.rlib" "C:\\Users
\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libg
imli-517a95b0a57b9e8e.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rus
tlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-82d48d88ac13ce1c.rlib" "C:\\Users\\shale\\.rustup\\too
lchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-37de12e440fa
77bc.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-w
indows-gnu\\lib\\librustc_std_workspace_alloc-7549ba16005c4b88.rlib" "C:\\Users\\shale\\.rustup\\toolchain
s\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-b131f4022158fa79.rlib
" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gn
u\\lib\\libcfg_if-bfa5ff0422f13358.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-
gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-454b6cdb3888a4db.rlib" "C:\\Users\\shale\\.rustup\\
toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-90ee5fe37d110
9a4.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-wi
ndows-gnu\\lib\\librustc_std_workspace_core-f5802464b35b87c4.rlib" "C:\\Users\\shale\\.rustup\\toolchains\
\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-7ca46f1af2cdfb26.rlib" "-
Wl,--end-group" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64
-pc-windows-gnu\\lib\\libcompiler_builtins-13d041c714b5c5f4.rlib" "-Wl,-Bdynamic" "-lcsfml-graphics" "-lcs
fml-window" "-lcsfml-audio" "-lcsfml-system" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread
.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\\Users\\shale\\.rust
up\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld
.exe: D:\tmp\source\rs\rimg\target\debug\deps\libsfml-b9afb2dd96dce8b0.rlib(sfml-b9afb2dd96dce8b0.sfml.5zo
luu9r-cgu.11.rcgu.o): in function `sfml::graphics::render_texture::RenderTexture::with_settings':
          C:\Users\shale\.cargo\registry\src\github.com-1ecc6299db9ec823\sfml-0.16.0\src\graphics/render_t
exture.rs:57: undefined reference to `sfRenderTexture_createWithSettings'
          collect2.exe: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `rimg`

Windows 10
Gnu Tool Chain
Rust 1.52.1

6
why are you trying to open from memory the file that you just did read? why don't you simply use 'openFromFile'?
anyway, if you really want to have the resource included in your executable, this is how you do it.

I was just using it as an example, in my app ill try to download the data from the internet  ;)

and thanks @kojack that's exactly what I wanted   

7
so what should I use to get the binary without corrupting the data?

8
Like when we have the data stored in a char[] or std::string?

and is the same possible for sf::Music with .wav and .ogg files?

I tried this.... but...
I kinda regret it now...

That was hell...

#include <iostream>
#include <fstream>
#include <ios>
#include <SFML/Audio.hpp>


int main()
{
        std::string str = "";
        std::string file = "";
        std::ifstream fileStream("audio.wav", std::ios::binary);
        while(getline(fileStream, str))
        {
                file += str;
        }

        sf::Music audio;
        audio.openFromMemory(file.data(), file.length());
        audio.play();

        while(audio.getStatus() != sf::SoundSource::Stopped){}


        return 0;
}
 

9
System / Re: sf::Thread error
« on: May 24, 2021, 09:43:18 am »
So uh now I have another issue with sf::Thread or rather maybe its just not a feature but

when ever I pass in more than 1 variable it gives me a bunch of errors

Quote
$ g++ main.cpp `pkg-config --libs sfml-all`
main.cpp: In function 'int main()':
main.cpp:14:33: error: no matching function for call to 'sf::Thread::Thread(int (*)(const char*, const char*), const char [4], const char [4])'
   14 |  sf::Thread t(&foo, "str", "lol");
      |                                 ^
In file included from D:/msys64/mingw64/include/SFML/System.hpp:43,
                 from main.cpp:2:
D:/msys64/mingw64/include/SFML/System/Thread.hpp:126:5: note: candidate: 'template<class C> sf::Thread::Thread(void (C::*)(), C*)'
  126 |     Thread(void(C::*function)(), C* object);
      |     ^~~~~~
D:/msys64/mingw64/include/SFML/System/Thread.hpp:126:5: note:   template argument deduction/substitution failed:
main.cpp:14:33: note:   mismatched types 'void (C::*)()' and 'int (*)(const char*, const char*)'
   14 |  sf::Thread t(&foo, "str", "lol");
      |                                 ^
In file included from D:/msys64/mingw64/include/SFML/System.hpp:43,
                 from main.cpp:2:
D:/msys64/mingw64/include/SFML/System/Thread.hpp:103:5: note: candidate: 'template<class F, class A> sf::Thread::Thread(F, A)'
  103 |     Thread(F function, A argument);
      |     ^~~~~~
D:/msys64/mingw64/include/SFML/System/Thread.hpp:103:5: note:   template argument deduction/substitution failed:
main.cpp:14:33: note:   candidate expects 2 arguments, 3 provided
   14 |  sf::Thread t(&foo, "str", "lol");
      |                                 ^
In file included from D:/msys64/mingw64/include/SFML/System.hpp:43,
                 from main.cpp:2:
D:/msys64/mingw64/include/SFML/System/Thread.hpp:75:5: note: candidate: 'template<class F> sf::Thread::Thread(F)'
   75 |     Thread(F function);
      |     ^~~~~~
D:/msys64/mingw64/include/SFML/System/Thread.hpp:75:5: note:   template argument deduction/substitution failed:
main.cpp:14:33: note:   candidate expects 1 argument, 3 provided
   14 |  sf::Thread t(&foo, "str", "lol");
      |                                 ^
In file included from D:/msys64/mingw64/include/SFML/System.hpp:43,
                 from main.cpp:2:
D:/msys64/mingw64/include/SFML/System/Thread.hpp:48:23: note: candidate: 'sf::Thread::Thread(const sf::Thread&)'
   48 | class SFML_SYSTEM_API Thread : NonCopyable
      |                       ^~~~~~
D:/msys64/mingw64/include/SFML/System/Thread.hpp:48:23: note:   candidate expects 1 argument, 3 provided

code:

#include <iostream>
#include <SFML/System.hpp>
#include <string>

int foo(const char x[], const char y[])
{
        while(1)
        std::cout << "Func foo(int) << param: " << x << std::endl;
}

int main()
{

        sf::Thread t(&foo, "str", "lol");
        t.launch();

        while(1)
        {
                std::cout << "main thread" << std::endl;
        }

        return 0;
}
 

So is there any way to use multiple parameters?
or do I have to go with std::thread?

10
General / Re: Get Keyboard input without a window(Console)
« on: May 11, 2021, 02:11:41 pm »
I didn't understand can I like get a pseudo code?

Quote
You'd have to keep an array of what keys are pressed

Like in an array?

so do we do it like this :

if(array.at(array.size()) == sf::Keyboard::K)
{
    // Do stuff //
}
 
is it like that? or

11
General / Re: Get Keyboard input without a window(Console)
« on: May 10, 2021, 01:31:11 pm »
Is there a way to get the input only when it got pressed,

Like a short pulse?
like WM_KEYDOWN?

12
General / Get Keyboard input without a window(Console)
« on: May 09, 2021, 09:02:11 pm »
I cant get user input without a window,

because I have to use

while(window.pollEvent(event))
{
    switch(event.type)
    {}
}
 

So, is there any way for me too get user input without a window?

13
Thanks! that worked beautifully well!

14
Is there any help I can get with this... :(

15
System / Re: sf::Thread error
« on: May 05, 2021, 03:13:42 pm »
Oh ok thx

Pages: [1] 2