Results 1 to 5 of 5

Thread: How to include a OpenGL graphics area into a "standard MS Windows windows"

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2005

    How to include a OpenGL graphics area into a "standard MS Windows windows"

    I use the following commands to create a OpenGL graphics window (implemented into C++ / Borland C++ Builder):


    Works great, but actually I do not want a separate windows.

    Do you know, how this can be done :
    I want to create a normal console (I call it windows windows *g*) and want part of it to be the active OpenGL area. You get the clue what I mean, my English is limited.

    I would appreciate your help a lot!!

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2005

    Re: How to include a OpenGL graphics area into a "standard MS Windows windows"


    i am working in a very similar thing... and i found a very good (and free) component for c++ builder:

    With this, you just have to insert the Object in the Form, and start working


    PD: do you speak spanish?

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2001
    Eastern USA

    Re: How to include a OpenGL graphics area into a "standard MS Windows windows"

    If by console window you mean command window then I do not think you will get what you want without significant code writing.

    However, if what you want is to have something like the screensaver preview box under the control panel, then it's quite doable. Remember that just about any discrete rectangular (or even nonrectangular these days) portion of the screen (and some invisible) in actually a window to Windows. Many of these windows, if you can get a copy of their window handles (HWNDs) you can go through your normal OGL startup routine and see if it works. The problem is changing the settings of the HWND and getting device contexts to play nicely since in this case you are insistently fooling with someone else's (in terms of processes) property.

    However if you create an application, and define a rectangular region of your client area as a plain flat, detailless window, you should be able to get a handle of its device context, and then create a rendering context to do your OGL work.

    I did this once in Visual BASIC as a "I wonder if" project and used a VB Picture Box as my base window; oddly it would only work if I did things in a certain order, but oh well.

  4. #4
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Bay Area, CA, USA

    Re: How to include a OpenGL graphics area into a "standard MS Windows windows"

    You don't do this with a console. A console window is 'special' it's a shell, a program in itself and you cannot alter it. What you're asking to be able to do is alter the windows graphics output of a running program, don't even go there.

    However in Windows you don't or need a shell to run programs, and you are asking for the wrong thing. What you really want is to know how to write a normal windows program that doesn't launch a shell.

    Edit: I had suggested that using WinMain instead of main will stop the creation of a console (this has been my experience from old memory), but maybe you can do this via a project setting I'm unsure and I don't want to give faulty advice. I usually roll my own apps and don't use GLUT, and main never gets a lookin on anything I write for Windows. Anyhoo, WinMain is my final answer .

    So try the WinMain route (You may want to dispense with args to glut init but who cares, none of it's business and very X-like philosophy IMHO, just make sure you send in valid pointers and an arg count of 1, "the program name").

  5. #5

    Re: How to include a OpenGL graphics area into a "standard MS Windows windows"

    What does this thing do? I don`t want to install it, right now. Is it a own programm, or is it something I can include into my cpde?

    What I want, is something like in the screenshot of Carlos link. I create a environment, and part of that environment is a graphics area, where I can use all OpenGL commands on it.

Similar Threads

  1. Graphics Displayed in Windows Photo Viewer vs OpenGL Texture Rendering
    By OceanJeff40 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-12-2018, 06:29 AM
  2. Replies: 2
    Last Post: 07-30-2012, 04:38 AM
  3. OpenGL Windows Open, But No Graphics
    By Pedersen in forum OpenGL: Linux
    Replies: 8
    Last Post: 03-09-2003, 10:00 AM
  4. Replies: 0
    Last Post: 03-14-2002, 08:03 PM
  5. black area on right of screen in Windows
    By imported_ben in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 08-15-2000, 10:54 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