Use iostream stuff to ensure stdlibc++ linking is ok.
This commit is contained in:
parent
a3c1a5eaa3
commit
47400c70c3
|
@ -1,10 +1,14 @@
|
||||||
#include<SDL.h>
|
#include<SDL.h>
|
||||||
#include<memory>
|
#include<memory>
|
||||||
|
#include<iostream>
|
||||||
|
#include<string>
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
SDL_Surface *screenSurface;
|
SDL_Surface *screenSurface;
|
||||||
SDL_Event e;
|
SDL_Event e;
|
||||||
int keepGoing = 1;
|
int keepGoing = 1;
|
||||||
|
std::string message;
|
||||||
|
|
||||||
if(SDL_Init( SDL_INIT_VIDEO ) < 0) {
|
if(SDL_Init( SDL_INIT_VIDEO ) < 0) {
|
||||||
printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
|
printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
|
||||||
}
|
}
|
||||||
|
@ -13,6 +17,12 @@ int main(int argc, char **argv) {
|
||||||
std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> window(SDL_CreateWindow( "My application", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN), SDL_DestroyWindow);
|
std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> window(SDL_CreateWindow( "My application", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN), SDL_DestroyWindow);
|
||||||
screenSurface = SDL_GetWindowSurface(window.get());
|
screenSurface = SDL_GetWindowSurface(window.get());
|
||||||
|
|
||||||
|
// Use iostream etc to make sure we have not screwed
|
||||||
|
// up libstdc++ linking.
|
||||||
|
message = "Window created.";
|
||||||
|
message += " Starting main loop.";
|
||||||
|
std::cout << message << std::endl;
|
||||||
|
|
||||||
while(keepGoing) {
|
while(keepGoing) {
|
||||||
while(SDL_PollEvent(&e) != 0) {
|
while(SDL_PollEvent(&e) != 0) {
|
||||||
if(e.type == SDL_QUIT) {
|
if(e.type == SDL_QUIT) {
|
||||||
|
|
Loading…
Reference in New Issue