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

Pages: [1]
1
C / How do I use 'sfRenderStates'?
« on: August 26, 2015, 05:49:44 am »
Code: [Select]
sfRenderStates *text_mode;
text_mode.blendMode = ?;

I don't know what to put there...

also, is there way to make my text not get 'resized'? when I resize my window, my text gets resized too...

2
General / Re: Why does 'mouseButton' returns mouse's x position?
« on: July 30, 2015, 10:18:07 pm »
Thanks for the answers...but I still don't get this one thing.

mouseButton.button function constantly returns the value of my mouse's x coordinate whenever I move my mouse. But why only X coordinate? why not return Y coordinate as well?


Also, how does mouseButton.x and mouseButton.y work?

Code: [Select]
std::cout << mouseButton.x << std::endl;

This prints out Y coordinate of my mouse constantly...when I click my mouse, then it returns my X coordinate...if I need to check where I clicked my mouse, shouldn't the Y coordinate disturbs my X coordinate? how do you distinguish which is my X coordinate?

3
General / Why does 'mouseButton.button' returns mouse's x position?
« on: July 30, 2015, 09:26:45 am »
What's the difference between using 'sf::Mouse::isButtonPresessed' and 'sf::Event::mouseButton.button'?

mouseButton function somehow returns the value of the x coordinate of the mouse. Of course it also returns weather I clicked my mouse or not. But why does it return the x coordinate of my mouse?

Finally, which of the above function is recommended?

4
General / Re: undefined reference to 'WinMain@16'
« on: July 29, 2015, 09:45:35 am »
Oh, um... *facepalm...I spent my whole day to find the bug and it was because I misspelled... guess I gotta learn how to spell things. Thanks for the solution!

5
General / Re: undefined reference to 'WinMain@16'
« on: July 29, 2015, 03:24:16 am »
No effects...

Code: [Select]
g++ -std=c++11 window.cpp -o window.exe -L. -mwindows -lsfml-main -lsfml-window -lsfml-system
It gives me the same error...oh and is sfml-main necessary? what does it do?

6
General / undefined reference to 'WinMain@16'
« on: July 29, 2015, 02:02:34 am »
*EDIT* oops, I accudently posted this in the wrong forum. Does anyone know how to remove or move this post to 'help general forum'? Thanks




I did everything right. I built SFML using Cmake with MSYS configuration. Then I copied exact code from the tutorial which looks like this,


Code: [Select]
#include <SFML/Window.hpp>


int mian(){
    sf::Window window(sf::VideoMode(500, 400), "Window", sf::Style::None);
   
   
    while(window.isOpen()){
        sf::Event event;
       
        while(window.pollEvent(event)){
            if(event.type == sf::Event::Closed){
                window.close();
            }
        }
    }

    return 0;
}



This is my compilation...

Code: [Select]
g++ -std=c++11 window.cpp -o window.exe -L. -lsfml-main -lsfml-window -lsfml-
system

It gives me this error...

Code: [Select]
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libmingw32.a(main.o):(.text.start
up+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
make: *** [all] Error 1



What's my problem?

7
General / I want to make 3D games. (newb question alert)
« on: April 12, 2015, 02:02:40 am »
If SFML only supports 2D graphics but I want to make 3D games, what do I do? How do I use 3D OpenGL with SFML? can you give me some links that could help me? thanks...

8
General / Which version of OpenGL does SFML 2.2 use?
« on: April 08, 2015, 05:34:17 am »
I'm sorry if this is too newb question...but I heard that if you install SFML, it comes with OpenGL so that I don't have to download OpenGL explicitly. But which version of OpenGL does it comes with? or I should say, does version matter? what's the difference between modern OpenGL and old OpenGL? thanks...

9
General / Why am I able to link opengl32.lib even if I don't have one?
« on: April 07, 2015, 04:18:06 am »
Little bit confused about how MinGW linking works...


I have a test folder and inside of the test folder, I have a exe file and have a lib folder which contains bunch of SFML lib files. Now, here's where I pissed off. I created a makefile that will compile my main.cpp file and I used -L to specify to look for the lib folder and used -l flags to tell which libs i'm using. Since I'm only using window features, I used -llibsfml-window. I compiled my main.cpp and got an error...I changed my -llibsfml-window to -lsfml-window which doesn't make sense because in my lib folder, there is no such file called sfml-window, but it worked, and I have no idea how this is working...maby because i'm newb and don't really understand how MinGW works...for me, more confusing thing is that even though I have no file called opengl32 in my lib folder, it compiles fine...am I just not understanding how MinGW works? how come MinGW compiles opengl32.lib even though I don't have opengl32.lib? thanks.

10
General / Re: Help me linking with MinGW (command prompt)
« on: April 07, 2015, 12:58:47 am »
I fixed it by downloading SFML-Master INSTEAD of SFML. Then I used camke to create cmake file for MinGW and then I compiled it using mingw32-make. Next, I copied my dll and lib files which are generated by akefile and moved to a folder where my main.exe is. When I run my exe file, it works perfectly fine.

Now, this is so confusing me. I'm going to have to learn how dll and lib files work...

11
General / Re: Help me linking with MinGW (command prompt)
« on: April 06, 2015, 02:49:44 pm »
I'm sorry, i'm holding this topic too long. I already copied my graphics.dll and moved to my executable but it still doesn't work (same error happens with the example codes). I'm thinking of giving up SFML and get in to another library if this won't work...

12
General / Re: Help me linking with MinGW (command prompt)
« on: April 06, 2015, 03:26:38 am »
What does that mean? I'm using libsfml-graphics.a and my dll is sfml-graphics-2.dll

13
General / Re: Help me linking with MinGW (command prompt)
« on: April 06, 2015, 03:09:04 am »
Somehow, I managed to fix this problem and was able to make an execrable file. But i'm getting an error whenever I try to run my program. (also, I get the same error whenever I try to run sample codes.)

"The procedure entry point
_ZN2sf4Font12LoadFromFileERKsjRKNS_7Unicode4TextE could not be located in the dynamic link library sfml-graphics.dll"

What's wrong with this?

14
General / Help me linking with MinGW (command prompt)
« on: April 05, 2015, 11:46:01 pm »
So, I just registered today and I have to say that SDL SUCKS >:(. They don't care about MinGW windows users. I'm pretty sure SFML is more suppportive with MinGW Windows.

So here's my problem. I found that SFML includes libraries with <> operator, which means that I have to put my include folder inside of MinGW folder because <> will look for my MinGW directory, not my current directory. So it solved my problem. But now I have a new problem. Whenever I compile my main.cpp file, I'm getting tons of undefined reference errors. I think this is because of lib files but I have no idea how to link them. Where do I put my lib files? inside of MinGW or my current directory? and do I use
Code: [Select]
-L/mypath -lsomething?

thanks.

Pages: [1]
anything