"Windows has triggered a breakpoint"

Im tring to use opengl with SDL, but im having a problem whit SDL_SetVideoMode()
Im using visual studio 2005 pro, windows 2000

theres no errors at building it, it just happens when i execute the program, heres the message:
"Windows has triggered a breakpoint in Open GL Teste1.exe.

This may be due to a corruption of the heap, and indicates a bug in Open GL Teste1.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information"

So visual studio gives me a green arrow wheres my SDL_SetVideoMode function are:

[b]if(SDL_SetVideoMode(640,480,0,SDL_OPENGL)==0)cout<<SDL_GetError()<<endl;[/b]

If i take the argument “SDL_OPENGL” out it works fine…

Here’s the output of VS:
HEAP[Open GL Teste1.exe]: Invalid Address specified to RtlFreeHeap( 130000, 15cf40 )
Windows has triggered a breakpoint in Open GL Teste1.exe.

This may be due to a corruption of the heap, and indicates a bug in Open GL Teste1.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
HEAP[Open GL Teste1.exe]: Invalid Address specified to RtlFreeHeap( 130000, 1426c0 )
Windows has triggered a breakpoint in Open GL Teste1.exe.

This may be due to a corruption of the heap, and indicates a bug in Open GL Teste1.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
HEAP[Open GL Teste1.exe]: Invalid Address specified to RtlFreeHeap( 130000, 15f0e0 )
Windows has triggered a breakpoint in Open GL Teste1.exe.

This may be due to a corruption of the heap, and indicates a bug in Open GL Teste1.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
The program ‘[1076] Open GL Teste1.exe: Native’ has exited with code 0 (0x0).

Those are my additional dependences( properties/linker/input):
SDL.lib
SDLmain.lib
openGL32.lib

and my includes:
#include “SDL/SDL.h”
#include “SDL/SDL_opengl.h”

I dont know whats happening…

edit: since its the first time im tring to use opengl, maybe im missing something stupid…i don’t know…

Can be you use different libs and dlls of SDL from different versions. make sure you get fresh ones. happend to me once with directx as well (heap).

But i never got other SDLs, and my other SDL programs are working

And if i take the SDL_OPENGL argument out it works…

download the latest. if you have other sdl apps they will work with their own sdl dll’s of course. im talking about different dll/lib version at linking time. its the only thing the pops into my head right now.

My sdl is the last

theres something that are really annoing me, looks like nobody want you to using opengl

what do you need to configure your computer or your ide to start using open gl?? theres a million of tutorials and all are different from each other, i dont know what to do…

do i need to download something? do i need create some folders? put any libs or dlls in some folder? what i have to configure in visual studio, in the properties to use opengl?? why some say to download some stuff, and others say that windows and visual studio alredy comes prepared to it <o> im getting crazy

you don’t need to download anything.
make sure you bind OpenGL32.lib and include <GL/gl.h> header.
that’s actually all. you would not be able to compile otherwise.
if you want to use extensions include <GL/glext.h> as well.

#include <GL/gl.h>
#pragma comment (lib,“OpenGL32.lib”)

So im doing all correct, but still getting the error.

I figured out i can run the programs, but the error keep poping up and i have to press CONTINUE a few times, until get in a port of the code that something actually happens( like draw or move an squad until i press a key), so when it ends at return 0 it pops up again…

I think is a problem with my video card so…?
but it looks so nonsense, i mean, it gives a problem just to load Opengl, not using something specific, and i can run opengl tests(on opengl extension viewer, i can run render tests until 1.3)
so i dont get it…
tanx for the help

i havent used SDL yet, maybe it makes use of some extensions that are not supported. this way you might get 0x0000000 on some GL functions pointers and thus a crash. you can step through the code and post some lines where it crashes or shows errors.
OpenGL 1.3 isn’t really top drawer these days. what graphics card you have?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.