Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 20th, 2005, 5:28 AM   #1
brenda
Newbie
 
brenda's Avatar
 
Join Date: May 2005
Posts: 6
Rep Power: 0 brenda is on a distinguished road
MFC/OpenGL: 'CDocument' class problem

I have a question about using MFC classes alongside the OpenGL API :o)

I have been working on this project(MFC) for a few days. Past applications I have worked on were built using win32 programs. I need to start using MFC class wrappers because the group I'm working with refuses to use the raw win32 API ^^
Here are the specifications:

  • 4 class Doc/View architecture
  • [base class]OGLView:CView -> [derived class]myView

    The only overridden function is ::RenderScene.
    Everything else is maintained through the OGLView class.

  • the OGLView class has everything needed to set up an OpenGL window.


The toolbar msg is handled by the CView class, which calls a function in the CDocument class. Just to get the processing going, I want to test this function by changing the background color. In other words, the draw logic for rendering 3d models will be in the CDocument class.

My problem is - I can't seem to render shapes, let alone affect the client area of an SDI application using the CDocument class.

^^ Most of you guys, who are helping others here, seem quite 'geeky' as me. Can you provide me with some helpful ideas?

thx in advance ^^

[edit] this has already been solved.

Last edited by brenda; May 21st, 2005 at 4:44 AM.
brenda is offline   Reply With Quote
Old May 20th, 2005, 9:57 AM   #2
kirkl_uk
Programmer
 
kirkl_uk's Avatar
 
Join Date: Apr 2005
Location: England
Posts: 86
Rep Power: 4 kirkl_uk is on a distinguished road
Send a message via MSN to kirkl_uk
This may seem an obvious thing, but are you using UpdateAllViews() or UpdateView() on your document after it is modified? I've never used OGLView, but I know this can cause issues in MFC. I wonder how the guys on here will feel about you calling them "geeky".

kirkl_uk
kirkl_uk is offline   Reply With Quote
Old May 20th, 2005, 10:40 AM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I take it as a compliment, even though I've never used OpenGL before.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 20th, 2005, 12:00 PM   #4
brenda
Newbie
 
brenda's Avatar
 
Join Date: May 2005
Posts: 6
Rep Power: 0 brenda is on a distinguished road
I'm sorry kirkl_uk, my last post might have been misleading.
class OGLView was coded by me. It's part of the modular design. You know, so I can also use this class in other programs :o)

[edit] this has already been solved.

Last edited by brenda; May 20th, 2005 at 9:17 PM.
brenda is offline   Reply With Quote
Old May 21st, 2005, 9:47 PM   #5
brenda
Newbie
 
brenda's Avatar
 
Join Date: May 2005
Posts: 6
Rep Power: 0 brenda is on a distinguished road
Admin, can you pull this short thread?
There's not much to see here.

btw, the solution is: the object was rendered once. When the call was made to redraw the view, the object would get deleted DUH! All I had to do was render the object after matrix stack operations and redrawing the view. yowserz!
brenda is offline   Reply With Quote
Old May 22nd, 2005, 1:15 AM   #6
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
wow this girl is smart.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old May 22nd, 2005, 5:18 AM   #7
kirkl_uk
Programmer
 
kirkl_uk's Avatar
 
Join Date: Apr 2005
Location: England
Posts: 86
Rep Power: 4 kirkl_uk is on a distinguished road
Send a message via MSN to kirkl_uk
lol. It sounds like you are impressed that there is such a thing as a smart girl.

kirkl_uk
kirkl_uk is offline   Reply With Quote
Old May 22nd, 2005, 7:23 AM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
There is? I never knew... wow... I'm gonna have to go rethink my philosophy on life now.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 22nd, 2005, 8:59 AM   #9
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
Originally Posted by kirkl_uk
lol. It sounds like you are impressed that there is such a thing as a smart girl.
Coming from where I live, I truly am
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old May 22nd, 2005, 8:50 PM   #10
brenda
Newbie
 
brenda's Avatar
 
Join Date: May 2005
Posts: 6
Rep Power: 0 brenda is on a distinguished road
:p Oh you're surely joking right?
Try a hundred(*exag) other women like me all at once:
brenda is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:17 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC