I figured some SDL guru's lurked around these areas...
I'm writing a... well, I fear saying 'game engine', because when I start to make stuff official, it starts to fail, but for the purposes of argument, a game engine. I'm using SDL to give me a windowing context at the current moment. Here's what I have:
main.h:
main.cpp:Code:int SW; int SH; int BPP; class SGE { public: SGE(); ~SGE(); void startWindow(int screenWidth, int screenHeight, int bitsPerPixel); void stopWindow(); private: }; SGE::SGE() { } SGE::~SGE() { } void SGE::startWindow(int screenWidth, int screenHeight, int bitsPerPixel) { screenWidth = SW; screenHeight = SH; bitsPerPixel = BPP; // Initialize SDL SDL_Init(SDL_INIT_EVERYTHING); // Set the SDL Video Mode SDL_SetVideoMode(SW, SH, BPP, SDL_OPENGL); // Set Window Caption SDL_WM_SetCaption("SGT Engine", NULL); glClear(GL_COLOR_BUFFER_BIT); SDL_GL_SwapBuffers(); } void SGE::stopWindow() { SDL_Quit(); }
I've taken some other (nothing that could cause the problem) stuff from my posted code, but this is it for the window stuff...Code:int main(int argc, char *argv[]) { SGE engineInstance; engineInstance.startWindow(20, 20, 32); engineInstance.stopWindow(); }
Thing is, when I run it, I just get a quick window that opens, and then it closes almost instantaneously. What is causing this sudden termination? Or, if worded wrong, what do I need to do to keep it open?
Thanks so much!
FlyingIsFun1217



LinkBack URL
About LinkBacks





)