Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-04

OpenGL/GLUT run time error when I whant compile this code

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Karim Forsthofer

Hello
I played around with the OpenGL unit, and I wrote some minimal OpenGL code to get a window: Here is the code:

program glbasic;
uses
  gl, glut;
const
  width = 640;
  height= 480;
procedure drawthings;
begin
  glClearColor(0.0, 0.0, 0.0, 0.0);
 (*will add some more code*);
end;
begin
  glutInit(@argc, argv);
  glutInitDisplayMode(GLUT_DOUBLE or GLUT_RGB);
  glutInitWindowSize( width, height);
  glutInitWindowPosition(0, 0);
  glutCreateWindow('glbasic');
  glutDisplayFunc(@drawthings);
  glutMainLoop();
end.

Now, when I whant to run to code, I get some Run time errors on the console:

Runtime error 216 at 0x4052F5CA
0x4051F5CA
Runtime error 216 at 0x0804C1CA
0x0849C1CA
0x0805127E

etc.
etc.
etc. (about 20 lines)

1). I know not a lot of runtime errors, but after succesfully compiling, that isn`t a fpc bug, is it ? What is the source of this run time error ? (mesa, fpc or my code ?) 2). I think about there isn`t enough code in the drawthings procedure to run succesfull.

What you think ?

Greetings
Karim F.

______________________________________________ http://www.linuxmail.org/ Now with e-mail forwarding for only US$5.95/yr Powered by Outblaze

Reply by email

James Mills
to Karim Forsthofer
Karim Forsthofer wrote 47 lines
Hello I played around with the OpenGL unit, and I wrote some minimal OpenGL code to get a window: Here is the code: program glbasic; uses gl, glut; const width = 640; height= 480; procedure drawthings; begin glClearColor(0.0, 0.0, 0.0, 0.0); (*will add some more code*); end; begin glutInit(@argc, argv); glutInitDisplayMode(GLUT_DOUBLE or GLUT_RGB); glutInitWindowSize( width, height); glutInitWindowPosition(0, 0); glutCreateWindow('glbasic'); glutDisplayFunc(@drawthings); glutMainLoop(); end. Now, when I whant to run to code, I get some Run time errors on the console: Runtime error 216 at 0x4052F5CA 0x4051F5CA Runtime error 216 at 0x0804C1CA 0x0849C1CA 0x0805127E etc. etc. etc. (about 20 lines) 1). I know not a lot of runtime errors, but after succesfully compiling, that isn`t a fpc bug, is it ? What is the source of this run time error ? (mesa, fpc or my code ?) 2). I think about there isn`t enough code in the drawthings procedure to run succesfull. What you think ?

That piece of code runs fine on my machine, except that my display doesn't support OpenGL GLX Extension :( hehe, need to compile my nvidia kernel drivers...

cheer
sJames

Show quoted text 13 lines
Greetings Karim F. -- ______________________________________________ http://www.linuxmail.org/ Now with e-mail forwarding for only US$5.95/yr Powered by Outblaze _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Sebastian Günther
to Karim Forsthofer: Hello I played around with the OpenGL unit, and I wrote some minimal OpenGL code to get a…
Karim Forsthofer wrote 7 lines
Now, when I whant to run to code, I get some Run time errors on the console: Runtime error 216 at 0x4052F5CA 0x4051F5CA Runtime error 216 at 0x0804C1CA 0x0849C1CA 0x0805127E

Compile with -gl as additional argument; this will dump the line number and source file of the crash. RTE 216 is an access violation, i.e. some pointer error. But the bug is not necessarily located in your code.

- Sebastian

Reply by email

Florian Klaempfl
to Sebastian Günther
Sebastian Günther wrote 15 lines
Am Sam, 2003-04-05 um 04.02 schrieb Karim Forsthofer: >Now, when I whant to run to code, I get some Run time errors on the console: > >Runtime error 216 at 0x4052F5CA > 0x4051F5CA >Runtime error 216 at 0x0804C1CA > 0x0849C1CA > 0x0805127E Compile with -gl as additional argument; this will dump the line number and source file of the crash. RTE 216 is an access violation, i.e. some pointer error. But the bug is not necessarily located in your code.

Missing glut.dll :) ?

Reply by email

Sebastian Günther
to Florian Klaempfl
Florian Klaempfl wrote 6 lines
> > Compile with -gl as additional argument; this will dump the line number > and source file of the crash. RTE 216 is an access violation, i.e. some > pointer error. But the bug is not necessarily located in your code. Missing glut.dll :) ?

uuh yes, that is probably the reason. I've checked the source once more, and while the OpenGL units try to load the libraries for themselves, they will silently discard any exception, which would get raised by missing libs.

- Sebastian

Reply by email