I learned some console application and win32, now I want to learn how to display an image. I don't know how to do it and what compiler to use. Can you please teach me step by step? Thanks.
Disch is saying that your question is way, way, WAY to broad and evidently you don't quite understand that fact yet. That's OK, you'll get there. You said you've "Learned some win32" so let's build from there: http://msdn.microsoft.com/en-us/library/dd162487(v=vs.85).aspx
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
// Create a 640x480 window with "My Program" for the title that updates no faster than 60 FPS
sf::RenderWindow window( sf::VideoMode(640,480), "My Program" );
window.setFramerateLimit(60);
// Load our image into a texture
sf::Texture texture;
texture.loadFromFile("splashscreen.png"); // load an image file
// Put our texture in a 'Sprite' -- an on-screen entity
sf::Sprite sprite(texture);
// Run the program loop
bool running = true;
while(running)
{
// Process incoming messages/events
sf::Event event;
while(window.pollEvent(event))
{
if(event.type == sf::Event::Closed) // does the user want to close the program?
running = false; // if yes, indicate we want the program loop to stop
// we don't care about other events for now
}
// Now, we update the screen
window.clear(); // first, clear whatever is on it
window.draw(sprite); // then draw our sprite
window.display(); // then display everything we have drawn
}
}
Just to help you - I spent weeks trying to display an image. Then, last night, I used Qt and did it in several seconds. I advise you to do the same. It is cross platform. And I tried to use SFML, and I couldn't get it to work without any unhandled exceptions. If you want to use Win32 or SFML.... good luck. I sure needed luck...
Sounds like you were using the wrong libs. Did you post a thread about it?
Actually, yes. Several. The people on the SFML forums were useless and just said "This is on the wrong subforum" or "Do more searching".
Finally, I got it to work, using some random youtube vid. But, if I try to use any other stuff other than a basic window, I get an unhandled exception. I quit with it really... But, that is irrelevant, so... moving on.
Qt isn't my go to for game developing (nothing is now, really. In fact I just use Unity), and SFML is from what I've heard ideal for it, but for game devving I am gonna just learn DirectX or OpenGL... probably OpenGL.
Actually, yes. Several. The people on the SFML forums were useless and just said "This is on the wrong subforum" or "Do more searching".
Yeah the SFML forums seem pretty lame. Did you post anything here?
Finally, I got it to work, using some random youtube vid. But, if I try to use any other stuff other than a basic window, I get an unhandled exception
Doesn't sound like you got it to work to me. =P
As for regular GUI stuff, Qt == Amazing
I've never actually tried Qt... but I've used wx. It's pretty good. Does Qt require you to use a custom IDE? I heard that from somewhere and I don't know if it's true or not. It always scared me away from it.
Yeah the SFML forums seem pretty lame. Did you post anything here?
Yes, here is the link: http://www.cplusplus.com/forum/lounge/136211/
I did get good advice, but not necessarily a solution. I archived it since it hadn't been any activity on it for a week and a half.
Doesn't sound like you got it to work to me. =P
Well... half working.... 1/4 working... not really. I can just get it to build, not run, is what I meant
I've never actually tried Qt... but I've used wx. It's pretty good. Does Qt require you to use a custom IDE? I heard that from somewhere and I don't know if it's true or not. It always scared me away from it.
No it doesn't. Most people use it just to avoid having to go through the troubles of linking it to a project, but no. I don't like it, only because you can't go into the project file path and run the .exe from there without doing a bunch of stuff. There is a library for it to link to Visual Studio and other IDEs, just like SFML or SDL. I plan on downloading that tonight, actually.
I don't mean to be a dick or anything but if you are trying to download a library the best place to look at would be the libraries site. http://lmgtfy.com/?q=sfml