| | |
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 |
Tag cloud for C++
api array arrays based beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library lines linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference return rpg simple spoonfeeding string strings struct temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets





