AllegroGL error at set_gfx_mode()

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 7
Reputation: Nickyu0712 is an unknown quantity at this point 
Solved Threads: 0
Nickyu0712 Nickyu0712 is offline Offline
Newbie Poster

AllegroGL error at set_gfx_mode()

 
0
  #1
Jul 29th, 2009
I just added the allegro and allegroGL packages to my DEV C++ compiler. But I have an error with the set_gfx_mode funtion. I have written this :
#include <allegro.h>
#include <alleggl.h>

int main() {
if (allegro_init() != 0) {
    return 1;
}
if (install_allegro_gl() != 0) {
    return 1;
}

install_keyboard();
install_timer();

allegro_gl_set(AGL_DOUBLEBUFFER, 1);
allegro_gl_set(AGL_WINDOWED, TRUE);
allegro_gl_set(AGL_COLOR_DEPTH, 32);
allegro_gl_set(AGL_SUGGEST, AGL_DOUBLEBUFFER | AGL_WINDOWED | AGL_COLOR_DEPTH);
if(set_gfx_mode(GFX_OPENGL, 640,340, 0, 0)) {
      allegro_message ("Error setting OpenGL graphics  mode:\n%s\n"
      "Allegro GL error : %s\n",
      allegro_error, allegro_gl_error);
      exit(0);
}

allegro_gl_set_allegro_mode();

textout_ex(screen, font, "Hello World!", 50, 100, makecol(255, 0, 0), -1);

allegro_gl_unset_allegro_mode();

allegro_gl_flip();
readkey();

return 0;
}
END_OF_MAIN()

At the the bolded line in the code I get a runtime error : "The instructuin at "0x00000000" referenced memory at "0x00000000". The memory could not be "read"."

What's the problem? And how to solve it?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC