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

Pages: [1]
1
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 11:08:19 pm »
It works on my stupid laptop but i did exactly the same.

2
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 09:58:00 pm »
It has to do with my Visual Studio. It works neither with Allegro. The Allegro window is closing after some time too.
Ill try to do it with Code blocks

3
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 07:15:24 pm »
Are you linking correctly? Debug libraries with debug build? Release libraries with release build? You downloaded the correct library for your compiler?

Configuration Debug:
sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib
sfml-network-d.lib
sfml-audio-d.lib

Configuration Release:
sfml-graphics.lib
sfml-window.lib
sfml-system.lib
sfml-network.lib
sfml-audio.lib

Visual Studio 2015        Sfml 14 (VS2015)

4
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 04:17:12 pm »
After some Testing i found out that this happens when im adding the
mainwindow.display();
line.

But why?

5
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 03:43:28 pm »
Don't run step by step. The debugger halts the execution automatically when the crash happens.

Heres some Output:
The Thread 0x3308 has ended with the code -1073740777 (0xc0000417).
The Thread 0x36bc has ended with the code -1073740777 (0xc0000417).
The Thread 0x39e4 has ended with the code -1073740777 (0xc0000417).
The Thread 0x32c0 has ended with the code -1073740777 (0xc0000417).
The Thread 0x4ed8 has ended with the code -1073740777 (0xc0000417).
The Thread 0x1408 has ended with the code -1073740777 (0xc0000417).
The Thread 0x2988 has ended with the code -1073740777 (0xc0000417).
The Thread 0x1fb8 has ended with the code -1073740777 (0xc0000417).
The Thread 0x4708 has ended with the code -1073740777 (0xc0000417).
The Thread 0x3808 has ended with the code -1073740777 (0xc0000417).
The Thread 0x21f0 has ended with the code -1073740777 (0xc0000417).
The Thread 0x2620 has ended with the code -1073740777 (0xc0000417).
The Thread 0x135c has ended with the code -1073740777 (0xc0000417).
The Thread 0xca4 has ended with the code -1073740777 (0xc0000417).
The Thread 0x300c has ended with the code -1073740777 (0xc0000417).
The Thread 0x405c has ended with the code -1073740777 (0xc0000417).
The Thread 0xc84 has ended with the code -1073740777 (0xc0000417).
The program "[19804] GameDevelopment.exe" was closed with the code -1073741510 (0xc000013a).

I dont know if it helps...
Ill try to run the Debug mode later cuz im reinstalling the Visual Studio right now maybe that will solve the problem... hopefully

It even wont work if its only the window which is drawn but it works if i use 'sf::Window' instead of 'sf::RenderWindow'

6
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 12:14:54 pm »
Run it through the debugger and figure out what goes wrong.
I already did but it enters the loop for like thousands of times and that in under 1msec so it would take forever to get the error

7
Window / Re: Window is closing after a few seconds
« on: July 12, 2016, 02:28:11 am »
The Message is

The Program "[9952] GameDevelopment.exe" was endet with the code -1073740777 (0xc0000417).
Help me please i dunno what to do  :'(

8
Window / Window is closing after a few seconds
« on: July 12, 2016, 12:30:40 am »
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>
#include <iostream>


int main() {
        bool walkl = false, walkr = false;

        sf::RenderWindow mainwindow(sf::VideoMode(1920, 1080), "Mein Erstes Spiel", sf::Style::Default);
        // Adding Background
        sf::Texture background;
        background.loadFromFile("background.png");
        sf::Sprite backgroundsprite;
        backgroundsprite.setTexture(background);
       

        // As long as Window is open
        while (mainwindow.isOpen()) {
               
                // clear window
                mainwindow.clear();

                // Draw here
                mainwindow.draw(backgroundsprite);

                // end the current frame
                mainwindow.display();



                sf::Event event;
                while (mainwindow.pollEvent(event)) {
                        switch (event.type) {
                        case sf::Event::Closed:
                                mainwindow.close();
                                break;
                        case sf::Event::KeyPressed:
                                if (event.key.code == sf::Keyboard::D) {
                                        walkr = true;
                                }
                                else if (event.key.code == sf::Keyboard::A) {
                                        walkl = true;
                                }
                                break;
                        case sf::Event::KeyReleased:
                                walkr = false;
                                walkl = false;
                        }
                       
                       
                }

                if (walkr == true){
                        std::cout << "Bewege nach Rechts" << std::endl;
                }
                if (walkl == true) {
                        std::cout << "Bewege nach Links" << std::endl;
                }
        }


        return 0;
}

Why is my window closing after 5 - 10 seconds?  :-\

9
Graphics / Re: Error with drawing a Sprite
« on: July 11, 2016, 08:42:38 pm »
Ok guys i fixed it.

There was a SFML_STATIC in the Debug properties which i didnt see before. After removing it it worked. Thanks guys

10
Graphics / Re: Error with drawing a Sprite
« on: July 11, 2016, 08:25:48 pm »
Looks a lot like this guy who defined SFML_STATIC without linking to the -s version of the library.
From your post, it's unclear if you defined SFML_STATIC. If you wrote SFML_STATIC somewhere but aren't linking to the static libs, delete it.

I didnt write SFML_STATIC in the properties...

11
Graphics / Re: AW: Error with drawing a Sprite
« on: July 11, 2016, 07:38:08 pm »
The error codes are indeed a bit strange, but I assume the issue is similar to pretty much every other linker error.
Make sure to only define DFML_STATIC when you link static libraries. Don't mix debug and release modes. Don't add multiple versions of thd same library to the linker field. Use libraries that are built for your compiler, i.e. don't use VS 13 libs in VS 14. Etc.

Can you provide the full build command?

Ive got the correct versions (Visual Studio 2015 and SFML C++ 14 which is for VS2015) and i dont have any static libraries linked. I didnt mix the release and debug modes. I dont know what it is.
Btw where can i find the full build command?

12
Graphics / Re: Error with drawing a Sprite
« on: July 11, 2016, 06:57:52 pm »
Giving us the real error message would be a nice second step. (after googling it)

LNK2001    Not listed external Symbol ""public: static class sf::RenderStates const sf::RenderStatesDefault" (?Default@RenderStates@sf@@2V12@B)".
LNK1120 1 Unlisted external

13
Graphics / Error with drawing a Sprite
« on: July 11, 2016, 05:42:30 pm »
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>


int main() {
        sf::RenderWindow mainwindow(sf::VideoMode(1920, 1080), "Mein Erstes Spiel", sf::Style::Default);

        sf::Texture background;
        background.loadFromFile("background.png");
        sf::Sprite backgroundsprite;
        backgroundsprite.setTexture(background);
       

        // As long as Window is open
        while (mainwindow.isOpen()) {
                sf::Event event;
                while (mainwindow.pollEvent(event)) {

                        if (event.type == sf::Event::Closed) {
                                // Hier kommt auch das speichern rein z.B.
                                mainwindow.close();
                        }

                        // clear window
                        mainwindow.clear();

                        // Draw here
                        mainwindow.draw(backgroundsprite);

                        // end the current frame
                        mainwindow.display();
                }
        }



        return 0;
}


I followed the Tutorial but im getting the error messages
LNK2001 and
LNK1120

Im not finding helpful thread on the internet ...
Please help me  :-X


[EDIT]
The error is where im trying to draw the sprite
mainwindow.draw(backgroundsprite);
When im removing this line it works (but obviously nothing is displayed)

Pages: [1]