Recent

Author Topic: OpenGL Koch Curve: Fixed and Rendering Well  (Read 389 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 684
OpenGL Koch Curve: Fixed and Rendering Well
« on: September 21, 2024, 02:38:12 am »
Tried to convert an OpenGL  Koch Curve fractal code from Delphi

Got an external access violation error.


I was rendering to the form canvas and not to the OpenGL control.
« Last Edit: September 21, 2024, 05:27:14 pm by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 684
Re: OpenGL Rainbow Koch Curve: External Access Error
« Reply #1 on: September 21, 2024, 03:47:22 am »
I replaced dglOpenGL with GL in uses and got rid of dglOpenGL.pas in Project inspector and now I don't have the access violation error. It compiles OK

I get a Yellow Koch Curve, but it is flashing.
« Last Edit: September 21, 2024, 03:52:11 am by Boleeman »

Lulu

  • Sr. Member
  • ****
  • Posts: 259
Re: OpenGL Koch Curve: Problems
« Reply #2 on: September 21, 2024, 10:18:28 am »
Hi, at the end of the FormPaint method, if you replace Refresh by Invalidate there is no flashing.
Tested on windows 10.
There is another problem: the app don't stop if I click on the red cross at top-right of the windows.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Boleeman

  • Hero Member
  • *****
  • Posts: 684
Re: OpenGL Koch Curve: Problems
« Reply #3 on: September 21, 2024, 11:17:08 am »
Thanks Lulu for the reply.

I worked out that I was not rendering to the OpenGL control, but to the Form1 canvas.

Now it is all fixed and working well.
« Last Edit: September 21, 2024, 05:29:18 pm by Boleeman »

Lulu

  • Sr. Member
  • ****
  • Posts: 259
Re: OpenGL Koch Curve: Problems
« Reply #4 on: September 21, 2024, 07:09:16 pm »
I worked out that I was not rendering to the OpenGL control, but to the Form1 canvas.

I didn't realise it either  :D
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

 

TinyPortal © 2005-2018