Results 1 to 2 of 2

Thread: MFC connection with OpenGL?

  1. #1
    Member Contributor
    Join Date
    Mar 2000
    Posts
    94

    MFC connection with OpenGL?

    Hi,
    I'm new to OpenGl and MFC exe files under Viisual C++. I'm learning how to do both. What I can't figure out is how to link the two together. I'm sure it is something simple but I can't get it.

    On one hand, if I create a simple Opengl picture(say to draw a triangle) under a win32 console application, compile, and run, everything is OK.

    If I create a simple dialog box where a user can enter in a number(MFC (appwizard)exe) I can't figure out how to harness that number on the Opengl side. I probablly did't explain that very well. i'm new to both OpenGl and MFC(not to mention C++) but I can do the basics in all three(very basics).

    I'm trying to draw a picture in OpenGl and have the user enter some input, and change the picture accordingly. Preferably with two simultaneous windows open. Someone here recomended me using a modeless dialog box(still trying to figure out what that is)
    using MFC for the input.

    I didn't get much luck using DOS as my input window.

    Where would I put my OpenGL code in an MFC exe project for it all to work together and how would I set it up? guess that sums up my long winded question.....

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    ...
    Posts
    28

    Re: MFC connection with OpenGL?

    hi ace_man,
    i'm quite new to mfc and opengl too,but i think i learned the simple basics now...
    however,your opengl-code should be in the CView class of your mfc app (like CDemoView or something).here you can work with the whole opengl stuff like palettes,rendering context and so on..
    For the dialog box,you have to make a new class derived from CDialog (like mySettingsDlg) where you can put your edit boxes and check boxes and stuff on it.then go to class wizard and link some flags (lighting on/off for example) with this objects.
    so,now you could make a menu point in your CView class,which starts the (modal) dialog box.in the command handler now you could say
    "mySettingsDlg dlg.m_lighting = lighting_flag" so the dialog box is updated every time you change the lighting flag. I dont know if this is the best way to do,but it works quite fine...(if i said something wrong here,please reply here ,guys)...hope this works

Similar Threads

  1. Edges Connection Graph
    By devdept in forum OpenGL: General
    Replies: 13
    Last Post: 06-09-2010, 01:52 AM
  2. Gracefully handling remote desktop connection
    By Sinsanity in forum OpenGL: Windows
    Replies: 5
    Last Post: 02-10-2010, 10:05 AM
  3. Low texture performance via remote X connection
    By imported_sansan in forum OpenGL: Linux
    Replies: 4
    Last Post: 09-15-2009, 05:27 AM

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