   Slow when not in debug mode?
  OK so when i run my application outside of debug mode it runs like it has zero 3D acceleration but when i run it in debug mode from my IDE (code::blocks) it runs grate 3600 32x32:32 images all dynamically rotating but when i run it out of debug mode on it's own it rotates them but FRAPS (a frame rate finding application very nice program, but only works on 3D accelerated applications) doesn't show up at all plus how is it rotating if there is no 3D accel(i use OpenGL to rotate things)? it doesn't make sense to me, can anyone tell me why this is happing and how to fix it. i don't think the problom is in the source code but here it is any way just in case. #include <Engine.h>TTF_Font *font = NULL;SDL_Event event;SDL_Color textColor = { 255, 255, 255 };FILE * ctt = fopen ("CON", "w");int i, j, k, x;bool KeyBuffer[257];vector<SpriteDispInfo> Info_Buffer;vector<Sprite>  Sprite_Buffer;using namespace std;void output (char *cout, char *Error) {    fprintf (stdout, cout, Error);    fprintf (stderr, "\n");}void outputNum (int num) {    std::stringstream test;    test << num;    fprintf (stdout, test.str().c_str());    fprintf (stderr, "\n");}int main_loop() {    bool quit = false;    Sprite_Buffer.reserve(3600);    Timer fps;    string File = "test.png";    Sprite tempS;    SpriteDispInfo tempI;    tempI.init(File,1);    Info_Buffer.push_back(tempI);    k=0;    for (i=0;i<1920;i+=24) {   for (j=0;j<1080;j+=24) {  tempS.init(tempI, i, j);  Sprite_Buffer.push_back(tempS);   }    }    i = 0;    j = 0;    k = 0;    while (quit == false) {   //Start the frame timer   fps.start();   //While there's events to handle   while (SDL_PollEvent (&event)) {  //If the user has Xed out the window  if (event.type == SDL_QUIT) { //Quit the program quit = true;  }   }   glClear( GL_COLOR_BUFFER_BIT );   //apply_surface (0, 0, Astroids, screen, NULL);   i++;   if (i==360) {  i=0;   }   for (j=0;j<Sprite_Buffer.size();j++) {  Sprite_Buffer.at(j).rotation = i;  Sprite_Buffer.at(j).display();  if (Sprite_Buffer.at(j).x == 1024) { Sprite_Buffer.at(j).x = 0;  }  if (Sprite_Buffer.at(j).y == 1024) { Sprite_Buffer.at(j).y = 0;  }   }   k=0;   //Update the screen   SDL_GL_SwapBuffers();   //Cap the frame rate   if (fps.get_ticks() < 1000 / 60) {  SDL_Delay ( (1000 / 60) - fps.get_ticks());   }    }}int main (int argc, char *argv[]) {    srand (time (NULL));    init();    main_loop();    return 0;}and Engine.h #ifndef ENGINE_H_INCLUDED#define ENGINE_H_INCLUDED#include <GL/gl.h>#include <GL/glu.h>#include <GL/glut.h>#include <SDL/SDL.h>#include <SDL_main.h>#include <SDL_opengl.h>#include <SDL_image.h>#include <SDL_ttf.h>#include <SDL_rotozoom.h>#include <SDL_mixer.h>#include <windows.h>#include <cstdio>#include <string>#include <sstream>#include <ctime>#include <cmath>#include <vector>extern "C" {    #include "lua.h"    #include "lualib.h"    #include "lauxlib.h"}using namespace std;void init();class SpriteDispInfo {public:    int intra,h,w;    SDL_Surface* Temp;    GLuint Tex;    void init (string file, int sintra);};class Sprite {public:    int x;    int y;    int w;    int h;    GLfloat rotation; // degrees    SpriteDispInfo info;    void init (SpriteDispInfo initInfo, int initialX = 0, int initialY = 0);    void display();    void kill();};class Timer {private:    //The clock time when the timer started    int startTicks;    //The ticks stored when the timer was paused    int pausedTicks;    //The timer status    bool paused;    bool started;public:    //Initializes variables    Timer();    //The various clock actions    void start();    void stop();    void pause();    void unpause();    //Gets the timer's time    int get_ticks();    //Checks the status of the timer    bool is_started();    bool is_paused();};#endif // ENGINE_H_INCLUDEDand engine.cpp#include <Engine.h>SDL_Surface* screen = NULL;int FRAMES_PER_SECOND;bool init_GL(){    //Set clear color    glClearColor( 0, 0, 0, 1 );    glEnable( GL_TEXTURE_2D );    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);    glEnable(GL_BLEND);    glMatrixMode( GL_PROJECTION );    glLoadIdentity();    glOrtho( 0, 1920, 1080, 0, -1, 1 );    //Initialize modelview matrix    glMatrixMode( GL_MODELVIEW );    glLoadIdentity();    //If there was any errors    if( glGetError() != GL_NO_ERROR )    {   return false;    }    //If everything initialized    return true;}int init_sdl() {    SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO);    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );    TTF_Init();    Mix_OpenAudio(22050, AUDIO_S16, 2, 4096);    SDL_WM_SetCaption ("Juice", NULL);    screen = SDL_SetVideoMode (1920, 1080, 32, SDL_OPENGL);    FRAMES_PER_SECOND = 60;}void init() { init_sdl(); init_GL();}GLuint ConvertSDL_SurfaceToOpenGLTex( GLuint texture,SDL_Surface *surface, GLenum texture_format, GLint nOfColors) {    if (surface) {// Check that the image's width is a power of 2   if ( (surface->w & (surface->w - 1)) != 0 ) {  printf("warning: image.bmp's width is not a power of 2\n");   }   // Also check if the height is a power of 2   if ( (surface->h & (surface->h - 1)) != 0 ) {  printf("warning: image.bmp's height is not a power of 2\n");   }   // get the number of channels in the SDL surface   nOfColors = surface->format->BytesPerPixel;   if (nOfColors == 4) {   // contains an alpha channel  if (surface->format->Rmask == 0x000000ff) texture_format = GL_RGBA;  else texture_format = GL_BGRA;   } else if (nOfColors == 3) {   // no alpha channel  if (surface->format->Rmask == 0x000000ff) texture_format = GL_RGB;  else texture_format = GL_BGR;   } else {  printf("warning: the image is not truecolor..  this will probably break\n");  // this error should not go unhandled   }   // Have OpenGL generate a texture object handle for us   glGenTextures( 1, &texture );   // Bind the texture object   glBindTexture( GL_TEXTURE_2D, texture );   // Set the texture's stretching properties   glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );   glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );   // Edit the texture object's image data using the information SDL_Surface gives us   glTexImage2D( GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0,  texture_format, GL_UNSIGNED_BYTE, surface->pixels );   return texture;   printf("SDL could not load image.bmp: %s\n", SDL_GetError());   SDL_Quit();   return 1;    } else {// Free the SDL_Surface only if it was successfully created   SDL_FreeSurface( surface );    }}SDL_Surface *load_image (std::string filename) {    //The image that's loaded    SDL_Surface* loadedImage = NULL;    //The optimized surface that will be used    SDL_Surface* optimizedImage = NULL;    //Load the image    loadedImage = IMG_Load (filename.c_str());    //If the image loaded    if (loadedImage != NULL) {   //Create an optimized surface   optimizedImage =   SDL_DisplayFormatAlpha (loadedImage);   //Free the old surface   SDL_FreeSurface (loadedImage);   //If the surface was optimized   if (optimizedImage != NULL) {  //Color key surface   }    }    //Return the optimized surface    return optimizedImage;}void apply_surface (int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL) {    //Holds offsets    SDL_Rect offset;    //Get offsets    offset.x = x;    offset.y = y;    //Blit    SDL_BlitSurface (source, clip, destination, &offset);}Timer::Timer() {    //Initialize the variables    startTicks = 0;    pausedTicks = 0;    paused = false;    started = false;}void Timer::start() {    //Start the timer    started = true;    //Unpause the timer    paused = false;    //Get the current clock time    startTicks = SDL_GetTicks();}void Timer::stop() {    //Stop the timer    started = false;    //Unpause the timer    paused = false;}void Timer::pause() {    //If the timer is running and isn't already paused    if ( (started == true) && (paused == false)) {   //Pause the timer   paused = true;   //Calculate the paused ticks   pausedTicks = SDL_GetTicks() - startTicks;    }}void Timer::unpause() {    //If the timer is paused    if (paused == true) {   //Unpause the timer   paused = false;   //Reset the starting ticks   startTicks = SDL_GetTicks() - pausedTicks;   //Reset the paused ticks   pausedTicks = 0;    }}int Timer::get_ticks() {    //If the timer is running    if (started == true) {   //If the timer is paused   if (paused == true) {  //Return the number of ticks when the timer was paused  return pausedTicks;   } else {  //Return the current time minus the start time  return SDL_GetTicks() - startTicks;   }    }    //If the timer isn't running    return 0;}bool Timer::is_started() {    return started;}bool Timer::is_paused() {    return paused;}void SpriteDispInfo::init (string file, int sintra) {    int count;    int skip;    int totalDegrees;    intra = sintra;    Temp = load_image (file);    Tex = ConvertSDL_SurfaceToOpenGLTex(Tex,Temp,GL_RGBA,4);    totalDegrees = ceil (360 / intra);    h = Temp->h;    w = Temp->w;    SDL_FreeSurface (Temp);}void Sprite::init (SpriteDispInfo initInfo, int initialX, int initialY) {    x = initialX;    y = initialY;    rotation = 0;    info = initInfo;    w = info.w;    h = info.h;}void Sprite::display() {    // determine which surface to display    glBindTexture( GL_TEXTURE_2D, info.Tex);    glPushMatrix();    glTranslatef(x+(w/2),y+(h/2),0);    glRotatef(rotation, 0, 0, 1);    glTranslatef(-x-(h/2),-y-(h/2),0);    glBegin( GL_QUADS );    //Bottom-left vertex (corner)    glTexCoord2i( 0, 0 );    glVertex3f( x, y, 0.0f );    //Bottom-right vertex (corner)    glTexCoord2i( 0, 1 );    glVertex3f( x, y+h, 0.f );    //Top-right vertex (corner)    glTexCoord2i( 1, 1 );    glVertex3f( x+w, y+h, 0.f );    //Top-left vertex (corner)    glTexCoord2i( 1, 0 );    glVertex3f(x+w, y, 0.f );    glEnd();    glPopMatrix();    glLoadIdentity();}well there it is, i hope someone can help   
  nvm i took out opengl32.dll and for some reason that fixed it, it doesn't need any of the gl*32.dll's for some reason, i'm using SDL_opengl to make it but i thought i would still need the gl*32.dll's for it to run. guess not, could some one explain why opengl32.dll made it run slow and why i don't need any of those dll's to run it.   ;  Check your project settings for debug and release mode. I don't use code::blocks, but in MSVC there are separate settings for both modes and you have to include opengl libraries in both. If you aren't including the proper library then your behavior sounds very plausible, on windows I think the default is a Microsoft software opengl implementation, which would be not hardware accelerated and really slow (but still work).   ;  kk thanks it's good to know, but i don't understand why "WITH" opengl32.dll it would be slow and software driven yet "WITHOUT" it would be fast and hardware driven.   