Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Utilizing Windows 7 style windows and fonts through OGL

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3

    Utilizing Windows 7 style windows and fonts through OGL

    Hello

    I recently have been learning about OpenGL and am using it as a graphics library to interface between LPA-WinProLog and Windows/Apple OS. Let me give you a bit of backstory so that you understand my questions a bit more clearly.

    I am a 2nd year Game Design student who has primarily used Microsoft Visual Studios to write programs in C# utilizing the XNA development library(which uses the DirectX graphics api...I think). However, for my summer job I am working on my grandfathers architectural program. Now my grandfather is a bit of a maverick when it comes to programming so he has been using WinProLog to write the program and about 10 years ago worked on something that allows ProLog to use OpenGL to handle the applications graphics.

    Now the problem, many people who use the program say it looks "old". My understanding is that this is because the OpenGL(and excuse my incorrect use of terminology here) libraries that he incorporated into ProLog, are using an older form of Window GDI. In order to update the look of the interface, dialogues, fonts etc. I am tasked with finding a way to incorporate the newer Windows graphics library, through OpenGl, into the application written in ProLog.

    My guess is that libraries that make Windows 7 applications look the way they do, are available in OpenGL or at least in some form of tool-kit like GLFW.

    If anyone could clear up how this whole thing works, or could point me in the correct direction as to how OpenGL libraries can make Windows 7 style windows I would greatly appreciate it. I will try to help out as much as I can, but like I said I am really only used to using the Windows development api that is built into languages like C#.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    What is a "Windows 7 style window?" I use Windows 7, and I don't know what you mean by this.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3
    I guess what I'm trying to say is what OGL library will allow me to make windows that "look" like an application running on Windows 7.

    I.e._A window, button or other interface feature that has similar 2D graphical features (transparency, font style etc) as an application running on Windows 7.

    Like I said I don't really have a handle on what I am talking about but I'll give it a shot:

    From my understanding, the Windows GDI is the 2D graphics API that handles the creation of windows, fonts, buttons etc. However, OpenGL is the open-source version of GDI, but has calls that windows to be opened depending on the OS being used. However, now Windows 7 uses Direct2D which built atop the old GDI. OpenGl is still an alternative, but there are libraries that can be used to acheive the same visual style in 2D. Is this right?
    Last edited by baule025; 07-14-2012 at 01:00 PM.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    From my understanding
    OK, I see where the problem is now. Let's look at each statement in turn.

    the Windows GDI is the 2D graphics API that handles the creation of windows, fonts, buttons etc: The Windows Graphics Device Interface (GDI) is a system for drawing to a device (which may be a window, or a printer, or other things). That's all it is.

    It has nothing to do with the "Look & Feel" of Windows; that's determined by however the Win32 API is implemented on a particular system. The GDI is about low-level drawing calls. Win32 and the various Windows setting determines things like what a button looks like. That's why it can be changed.

    OpenGL is the open-source: OpenGL is not open-source.

    OpenGL is the open-source version of GDI: OpenGL has nothing to do with the GDI or Windows. The creation of an OpenGL context on Windows requires using GDI calls (specifically creating a device context and setting a pixel format). But once you have a context, the GDI is irrelevant.

    OpenGL has nothing to do with the Windows Look&Feel for various GUI elements. There are no buttons, scroll-bars, etc in OpenGL. You could try to draw buttons that have a particular style, but there's no function that will do it for you.

    Windows 7 uses Direct2D: No it doesn't. It has Direct2D, but it doesn't use it explicitly for window drawing. You can choose to use D2D to do drawing in your application, but Win7 doesn't do it behind your back.

    You're confusing D2D with the Desktop Window Manager, which does window composition.

    Windows 7 uses Direct2D which built atop the old GDI: D2D is no more built on GDI than OpenGL is.

    Now that we're all on the same page here, what's your question?

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3
    Is there a tool-kit or some additional api/library for OpenGL (I've been reading about GLFW and the GLUT-like toolkits) that has calls for fancier button and window creation?

  6. #6
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    You seem to be confusing "window creation" and "widget (buttons, sliders, etc) creation". They're not the same thing (even though Win32 gives them a full HWND). So which are you looking for? The ability to create new full windows, or the ability to create widgets within your OpenGL window? Because if it's the latter, I'd suggest CeGUI.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •