sfml

SFML loadFromFile undefined reference

泪湿孤枕 提交于 2019-12-02 02:45:12
问题 I'm learning to use SFML with the idea of making a small game, so far I've created a window and messed about with it's settings, and set up a draw loop and event handler. The trouble started once I tried to add my first texture using the following code: #include "SpaceNomad.ih" void MainMenu(GameEngine &Engine) { sf::Texture texture; if(!texture.loadFromFile("MenuBackGround.png")) { cout << "couldn't load background texture\n"; } sf::Sprite *sprite = new sf::Sprite; sprite->setTexture(texture

Verifying sent packets on real time network using SFML

。_饼干妹妹 提交于 2019-12-02 02:42:55
I am building a networkable program that transfers graphical changes on a 2D screen with SFML UDP libraries. I want to run close to all of the processing on the host server, and only send the graphic updates and command return values to the client. I want to make a verify condition before the data is sent to the screens on both sides of the connection. I was thinking about sending a single byte as either 0 or 1 to represent successful reception of the data and to synchronize. (see diagram) Server-------( updates )----->Client | | ( wait for )<---( 1 or 0 )-----Send Byte | | ( if 1 ) ( if byte

OpenGL Rotation - Local vs Global Axes

夙愿已清 提交于 2019-12-02 00:59:09
问题 So I've got an object I'm trying to rotate according to a Yaw, Pitch and Roll scheme, relative to the object's own local axes rather than the global space's axes. According to this, I need to perform the rotations in that order. I've interpreted that to mean this: glRotatef(m_Rotation.y, 0.0, 1.0, 0.0); glRotatef(m_Rotation.z, 0.0, 0.0, 1.0); glRotatef(m_Rotation.x, 1.0, 0.0, 0.0); However, rotation around the Y and Z axes don't work. Rotation around the Y axis is always relative to the

Rogue line being drawn to window

牧云@^-^@ 提交于 2019-12-01 23:44:48
问题 I am making a graphing program in C++ using the SFML library. So far I have been able to draw a function to the screen. I have run into two problems along the way. The first is a line which seems to return to the origin of my the plane, starting from the end of my function. You can see it in this image: As you can see this "rogue" line seems to change colour as it nears the origin. My first question is what is this line and how may I eradicate it from my window? The second problem which is

The application was unable to start correctly (0xc00007b)

為{幸葍}努か 提交于 2019-12-01 22:39:56
问题 I've searched at a lot of places, asked a lot of people, but didn't found an answer to fix this issue.. I've just created a game in C++ with SFML in Visual Studio Community 2015. My project settings are set like they have to (followed this guide). When I runu the game on my pc, it works totally fine. If it runs on a pc without Visual Studio 2015, it will crash and returns the following error: The application was unable to start correctly (0xc00007b) I've also downloaded Dependency Walker, to

Rogue line being drawn to window

为君一笑 提交于 2019-12-01 22:19:21
I am making a graphing program in C++ using the SFML library. So far I have been able to draw a function to the screen. I have run into two problems along the way. The first is a line which seems to return to the origin of my the plane, starting from the end of my function. You can see it in this image: As you can see this "rogue" line seems to change colour as it nears the origin. My first question is what is this line and how may I eradicate it from my window? The second problem which is slightly unrelated and more mathematical can be seen in this image: As you can see the asymptotes which

Large text appears blurry

六眼飞鱼酱① 提交于 2019-12-01 21:15:03
I'm using SFML 1.6 to make a small game, and I need to display some text, so I use the sf::String class. The problem is, when I increase the size to 96pt, the edges appear a little blurry. When I increase the size of text in Microsoft Word though, it appears very clean and has crisp edges. Is there a way to do that with SFML? Looking at the SFML sources, it appears that it is using the embedded Arial font. Yes, it can also load the .ttf font file, but I guess you didn't load it yet. So the problem is tht SFML tries to scale the fixed-size bitmap when you are rendering the text. To get rid of

The application was unable to start correctly (0xc00007b)

心不动则不痛 提交于 2019-12-01 21:01:00
I've searched at a lot of places, asked a lot of people, but didn't found an answer to fix this issue.. I've just created a game in C++ with SFML in Visual Studio Community 2015. My project settings are set like they have to (followed this guide). When I runu the game on my pc, it works totally fine. If it runs on a pc without Visual Studio 2015, it will crash and returns the following error: The application was unable to start correctly (0xc00007b) I've also downloaded Dependency Walker, to check the .exe on errors and it results a couuple of errors. They can be seen in this screenshot .

Resizing in SFML 2.0

China☆狼群 提交于 2019-12-01 19:53:41
This may be a simple question but I'm having a hard time finding a straight answer to it: is there a way to resize a loaded Texture in SFML 2.0? For instance, if I have a 3264x2448 png and I want to scale it down to fit a 900x1200 rendered window without cropping, how would I do so? Is there a way to scale all rendered windows to fit whatever monitor of whatever system the application is running on? First, here's a way to scale the image to the current RenderWindow size. // assuming the given dimension // change this dynamically with the myRenderWindow->getView().getSize() sf::Vector2f

SFML Error loading font under Windows

霸气de小男生 提交于 2019-12-01 14:50:33
I've been trying to develop a cross-platform application for Windows and Linux using SFML. Everything's been going fine so far, except that the Windows version cannot seem to load fonts. I have no issues under Linux however. I did my research and made sure the file was in place, according to where I was executing from, but sf::Font::loadFromFile still returns false. Here's the code: sf::Font _font; sf::Text _text; if (!(_font.loadFromFile("resources/fonts/arial.ttf"))) { std::cerr << "Error loading font '" + font + "'" << std::endl; return; } _text.setFont(_font); Do you guys have any idea