Results 1 to 9 of 9

Thread: Setting up OpenGL

  1. #1
    Guest

    Setting up OpenGL

    I programm under Borland C++ Builder 6.0 and need to set up OpenGL for rendering in a TPicture component. How can I do this? I do correctly under a whole window dedicated for OpenGL even in a component such as TPanel and TButton but I like it to be a TPaintBox (that'd perfect). HELP!!!!

    By the way, how can I configure Outlook for reading this forum in it? I need the server.

    thx a lot.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Poland
    Posts
    196

    Re: Setting up OpenGL

    What's the difference which component you use?
    Every of them has unique hWnd (called handle) and this is only the one parameter you need to setup OpenGL.

  3. #3
    Guest

    Re: Setting up OpenGL

    Sorry, I meant I wanted to use the TPaintBox component (the one with a painter's brush in it).

    My question is: how can I initialize OpenGL for rendering in it? I can set it up for rendering in a TPanel component, but I'd like it to be a TPaintBox component.

    Thx

  4. #4
    Senior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    380

    Re: Setting up OpenGL

    errr, he told you how. All you need to set up an opengl window is the hWnd, just use the one from the TPaintBox instead of the windows handle. If you are using GLFW or GLUT you may have to switch to a windows api based approach. This isn't hard but is long, see nehe.gamedev.net for details.

  5. #5
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: Setting up OpenGL

    I don't know how it is in Builder, but in Delphi TPicture is a non-window control. It means - it has no window handle(it uses owners handle instead). If it also applies to Builder, well... sorry for you. You could develop an own component, however.

  6. #6
    Guest

    Re: Setting up OpenGL

    The simplest way is to render the GL scene to a bitmap and then render the bipmap into the controls canvas.

  7. #7
    Guest

    Re: Setting up OpenGL

    chowe6685: the TPaintBox component has no window handle but some other type so I can't do what you do.

    OLI-G: I can't render in an image because that's the question of my post.

    HELP!!!!!!!!!!!!

  8. #8
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Poland
    Posts
    196

    Re: Setting up OpenGL

    I don't get it, why can't you make it with simple TPanel?

  9. #9
    Guest

    Re: Setting up OpenGL

    Because I have everything in a TPaintBox component but without using OpenGL. If I keep that component I'll have to change fewer things.

    Does anybody know if what I'm trying to do is posible?

    Rendering to a TPanel would work if I could copy its canvas to the TPaintBox. I use the Draw method of the canvas which accepts no TCanvas for the source.

    HELP!!!!

Similar Threads

  1. Setting up OpenGL in VC++
    By oliver_kenny in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-23-2015, 10:42 PM
  2. Setting up Opengl
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-14-2004, 09:29 AM
  3. Setting up OpenGl under VC7
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-22-2004, 11:38 AM
  4. Setting up OpenGL
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-23-2002, 05:23 PM
  5. help setting up openGL!!
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-28-2002, 02:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean