Hello, I’ve been using wxDev-cpp to create windows with relative ease and now
I’m trying to create an SDL application with this. I was wanting there to be
a user-interface that would allow GUI elements that would be used for input
and textual output to the user, and then the SDL will be used to create a
different window that will basically show graphics. I’m trying out Lazy
Foo’s tutorials at http://www.lazyfoo.net/SDL_tutorials/lesson01/index2.php
and I loaded lesson01 and it works exactly as is, but when I launch the same
SDL window from within a Windows application using wxDev-Cpp, the SDL window
freezes when I click it and move it (And the image disappears), and then
when I try to click and move the GUI window that I plan to put user
interface elements on, it also freezes. Eventually, I get sick of it doing
nothing and so it’s terminated.
Anybody have insight into what the problem might be and if it’s fixable? If
it isn’t, is there another method for creating a window for user interface
elements and another window that’ll house the SDL that manipulate graphics
and do other SDL-goodness?
The following is the code for the main program.
//---------------------------------------------------------------------------
//
// Name: Project5App.cpp
// Author: a
// Created: 10/14/2009 9:15:12 PM
// Description:
//
//---------------------------------------------------------------------------
#include “Project5App.h”
#include “Project5Frm.h”
#include “SDL/SDL.h”
void startSdlWindow()
{
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Set up screen
screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
//Load image
hello = SDL_LoadBMP( "hello.bmp" );
//Apply image to screen
SDL_BlitSurface( hello, NULL, screen, NULL );
//Update Screen
SDL_Flip( screen );
//Pause
SDL_Delay( 200000);
//Free the loaded image
SDL_FreeSurface( hello );
//Quit SDL
SDL_Quit();
}
IMPLEMENT_APP(Project5FrmApp)
bool Project5FrmApp::OnInit()
{
Project5Frm* frame = new Project5Frm(NULL);
SetTopWindow(frame);
frame->Show();
//////////////
startSdlWindow();
/////////////
return true;
}
int Project5FrmApp::OnExit()
{
return 0;
}–
View this message in context: http://www.nabble.com/Developing-UI-GUI-and-SDL-through-wxDev-CPP--tp25902943p25902943.html
Sent from the SDL mailing list archive at Nabble.com.