| | |
AllegroGL error at set_gfx_mode()
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 7
Reputation:
Solved Threads: 0
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 :
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?
#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?
![]() |
Similar Threads
- C++ game error!!! (Game Development)
- Error Loading operating System (Windows NT / 2000 / XP)
- g++ allegro linking (C++)
- Grrr C++ Help Me! (C++)
- svchost.exe error (Windows NT / 2000 / XP)
- New Hardware Causing Error (Windows NT / 2000 / XP)
- office 2000 install error (Windows NT / 2000 / XP)
- VMWare Unrecoverable Error (*nix Software)
- Error in Wrox Book (Perl)
Other Threads in the C++ Forum
- Previous Thread: Hi buddies.......
- Next Thread: Array in class
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





