• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
zdkroot

Problems getting SFML to display a window.

8 posts in this topic

I've been trying to get SFML to simply create an empty window with a color in it for more hours than I care to admit. I was working through the [url="http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-Part-1.aspx"]this[/url] tutorial, when I apparently hit a wall. I completed through part 2, everything compiles fine, no errors, but when I run it I just get a blank dos prompt when a blinking cursor that I have to force close. The only debug output is

[CODE]
The thread 'Win32 Thread' (0x520) has exited with code -1073741510 (0xc000013a).
The thread 'Win32 Thread' (0x2c8) has exited with code -1073741510 (0xc000013a).
The thread 'Win32 Thread' (0xe98) has exited with code -1073741510 (0xc000013a).
The program '[3700] Pang2.exe: Native' has exited with code -1073741510 (0xc000013a).
[/CODE]

I've tried both vs2011 dev preview, and vs2008 express (too frustrated to install 2010 also...) and I get the exact same results. For vs2011 I compiled SFML myself, everything seemed to go fine there. In vs2008 I tried both the bundled DLLs and compiling my own, same result both times. Eventually I copy/pasted the code right from the tutorial, no luck. I even downloaded the "up to this point" project file from the tutorial, compiled it with no errors, black box, blinking cursor.


This code runs with no problems.
[CODE]
int main()
{
sf::Clock clock;
while (clock.GetElapsedTime() < 5.0f)
{
std::cout <<clock.GetElapsedTime() << "\n";
sf::Sleep(0.5f);
}
return 0;
}
[/CODE]


As soon as I try to create a sf::Window or sf::RenderWindow, it just hangs at the blinking cursor. This does not run.
[CODE]
int main()
{
sf::RenderWindow Window(sf::VideoMode VMode(800, 600, 32), "SFML Window");
while(Window.IsOpened())
{
sf::Event Event;
while (Window.GetEvent(Event))
{
switch (Event.Type)
{
case sf::Event::Closed:
Window.Close();
break;
default:
break;
}
}
Window.Clear(sf::Color(255,0,0));
Window.Display();
}
return 0;
}
[/CODE]

This also appears in the debug output...I don't know if any of it is bad.
[CODE]
'Pang2.exe': Loaded 'C:\Users\Zack\AppData\Local\Temp\ammemb.dll', Binary was not built with debug information.
'Pang2.exe': Unloaded 'C:\Windows\SysWOW64\atigktxx.dll'
'Pang2.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll'
[/CODE]

In the "modules" menu, sfml-window-d.dll and sfml-system-d.dll and ammemb.dll all have a red ! and the tooltip says "The module did not load at the default load address". sfml-graphics-d is listed and does not have the same error. All three DLLs are in the same folder. It also reports "Symbols not loaded" for everything in the module list except for Pang2.exe and ammemb.dll ("symbols loaded", and "binary not built with debug information" respectively).

I'm completely at a loss. I've used freeglut before and had no problems creating a window and drawing to it. Am I missing some dependency for building the vs2011 DLLs? Should I try vs2010 also? I'm rather tired of installing software, my system feels so bloated lately.

I run win7 x64 on a core2duo 2.93ghz and a radeon 4870 hd; I updated the drivers this morning. Thanks to anybody that feels like they need a headach...err wants to help. If you need any other information just ask.

[b][color=#ff0000]UPDATE: [/color][/b]I added SFML_STATIC; to the C++ preprocessor, and used the static lib files (the ones with -s in the name) and now the I can make all sorts of multicolored windows in SFML 1.6 and 2.0. I'm still not sure of the original issue. Edited by zdkroot
0

Share this post


Link to post
Share on other sites
Do not use the bundled DLLs, they are built for VS 2010. Instead use the DLLs downloaded from the SFML website.

That tutorial was written for Visual Studio 2010, and the dlls arent binary compatible between VS versions.


That or use VS 2010. :)
0

Share this post


Link to post
Share on other sites
You should change this:
[code]sf::VideoMode VMode(800, 600, 32)[/code]
to
[code]sf::VideoMode(800, 600, 32)[/code]

That line causes it to not compile on my system. I use G++ but either way it should not throw a compiler error. [s]That solves part of the problem.[/s]

EDIT: Forgot I didn't have my .dll's in the .exe's folder. You just need to remove the Vmode part. I can explain it a bit if you want. Edited by Dragonsoulj
0

Share this post


Link to post
Share on other sites
Serapth: I didn't use the bundled ones, I compiled my own for vs2011 and for vs2008 I used the ones from the sfml site, and compiled my own, to no avail.

Dragonsoulj: I just pasted the code I had been toying with trying to get it to work. I'm pretty sure I've tried every possible permutation of that line, and none of them worked.

On the up side, while trying out SFML-2.0, I was reading [url="http://www.sfml-dev.org/tutorials/2.0/start-vc.php"]this[/url] and it says you can add [CODE]SFML_STATIC;[/CODE] to the preprocessor, and change the dependencies to use the -s version of the .libs. That worked. Both with 2.0 and 1.6, in vs2008. I guess that just means it's some kind of DLL issue still? I extracted them straight from SFML-1.6.zip to the Debug directory with the exe, and it still won't display a window. If i set the SFML_STATIC; for the Release config, Release will compile and run fine, debug will not. Thoughts?

And thank you both for taking time to help [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
0

Share this post


Link to post
Share on other sites
You did have [code]SFML_DYNAMIC;[/code] set in your preprocessor since you were on the Debug configuration, right? I'll keep looking.

One of the reasons I went to command line was the problems that creep up with IDEs. Once they work they are fine, though. Worse comes to worse, I'll get a trial and see if I can help you out. I personally am a fan of SFML. ;)
0

Share this post


Link to post
Share on other sites
Actually no, I didn't see that in any of the tutorials o_O Am I really just that blind? I'll test that right now.

Edit: Nope, no change. Still won't run with [CODE]SFML_STATIC;[/CODE] set in the preprocessor. In debug or release. It still complains if it doesn't have the DLLs in the folder though... Edited by zdkroot
0

Share this post


Link to post
Share on other sites
Try adding the location they are in (say if they are in C:\SFML\includes\) to the PATH system variable. That option or placing them in the folder main folder are two options, since it should check both current directory and the system PATH directories. The other option you should have is just adding the .dlls to the project. I believe that is under Project->Add Existing Item or something, unless there is an option to specify external dependencies that I forgot about.

Your programs must have access to the .dlls at run-time, so if you pass them along, include them in the programs you give to people. I haven't found a way to embed them into the .exes yet.
0

Share this post


Link to post
Share on other sites
[left][font=helvetica, arial, verdana, tahoma, sans-serif][color=#282828][i]ARGH!!! The editor is pissing me off.. whats with the wierd "jumpiness" lately? You hit backspace and BLAMMO, randomly relocates to a different location and deletes something! [/i][/color][/font][/left]




[left][font=helvetica, arial, verdana, tahoma, sans-serif][color=#282828]Argh, anyways...[/color][/font][/left]

[left][i][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=4][background=rgb(250, 251, 252)]Your programs must have access to the .dlls at run-time, so if you pass them along, include them in the programs you give to people. I haven't found a way to embed them into the .exes yet.[/background][/size][/font][/color][/i][/left]

[left]Actually, you don't. This is exactly that the difference between static and dynamic compilation boil down to. When you compile for dynamic, your code inserts a "look over here for the code I am referencing" type marker, which simply is a contract stating that this code I am calling is located in a DLL named Blah.[/left]

[left]When you compile static on the other hand, you are telling the compiler/linker "copy all of this code into my executable". So, in both cases you use a lib to link to, but in the case of static, all of the code is actually copied into your final exe, while in the case of dynamic, it is not and thus you require DLL's be included with your application.[/left]

[left]I am oversimplifying it to a degree, but thats the gist. So essentially compiling static IS embedding them into the exe.[/left]


[left]As to the OP, SFML 1.6 is notorious for not playing well with ATI graphics cards. It seems to boil down to a missing DLL dependency, which is why static compilation causes the problem to go away. There is a [url="http://gamefromscratch.com/post/2011/08/25/This-is-some-kind-of-stupid.aspx"]fix of sorts for the problem[/url] you are having. Or you can use 2.0, which doesn't have the ATI issues.[/left]
0

Share this post


Link to post
Share on other sites
You know, I never had a problem with my ATI graphics card with SFML. It was OpenGL that gave me trouble.

And by that, I meant pure OpenGL code. It didn't render properly on some things. SFML any time I used it worked fine with regard to the card. Edited by Dragonsoulj
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0