Recent

Author Topic: Starting to use the TOpenGLControl...  (Read 7117 times)

Nafees

  • Jr. Member
  • **
  • Posts: 55
Starting to use the TOpenGLControl...
« on: May 28, 2015, 09:45:51 am »
I've been making a game engine of my own, and till now, I've used DirectX, but for some reason (I can't mention the reason), I've decided to use OpenGL. I found the TOpenGLControl component, and installed it. But how can I use it? I've tried the example files/project, but it uses the OpenGL directly, without TOpenGLControl. Please link a tutorial if you know about one, but not http://wiki.lazarus.freepascal.org/OpenGL_Tutorial, it just confuses me more and more. And one more thing: I don't want to use glut (ow whatever it is). I just want to use TOpenGL component, but how?

Windsurfer

  • Sr. Member
  • ****
  • Posts: 368
    • Windsurfer
Re: Starting to use the TOpenGLControl...
« Reply #1 on: May 28, 2015, 10:04:58 am »
Search in the examples for 'opengl'. They should get you started.

Carver413

  • Full Member
  • ***
  • Posts: 119
Re: Starting to use the TOpenGLControl...
« Reply #2 on: May 29, 2015, 01:56:39 am »
I believe nxpascal works this way
https://code.google.com/p/nxpascal/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Starting to use the TOpenGLControl...
« Reply #3 on: May 29, 2015, 08:41:50 am »
I believe nxpascal works this way
https://code.google.com/p/nxpascal/
No, it uses pure OpenGL API, not TOpenGLControl.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Starting to use the TOpenGLControl...
« Reply #4 on: May 29, 2015, 10:43:16 am »
Quote
I don't want to use glut (ow whatever it is). I just want to use TOpenGL component, but how?   
You'll have to learn OpenGL commands anyway, TOpenGLControl just provides the required infrastructure for your OpenGL instructions.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Starting to use the TOpenGLControl...
« Reply #5 on: May 29, 2015, 11:16:34 am »
Quote
I don't want to use glut (ow whatever it is). I just want to use TOpenGL component, but how?   
You'll have to learn OpenGL commands anyway, TOpenGLControl just provides the required infrastructure for your OpenGL instructions.
In essential, glut and TOpenGLControl (and glfw or any other similar library) provides what OpenGL doesn't provide: connection with underlying system.

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Starting to use the TOpenGLControl...
« Reply #6 on: June 02, 2015, 01:39:19 pm »
TOpenGlControl has an OnPaint()-Event. There you set usually the matrix mode, define the projection type, clear buffers, do transformations like zoom, rotate, translate, and draw your stuff. Take a look at the examples, read tutorials such as http://wiki.freepascal.org/OpenGL_Tutorial and ask more specific here. Good luck!
Lazarus 1.7 (SVN) FPC 3.0.0

 

TinyPortal © 2005-2018