Keeper
Jun 4 2005, 08:24 PM
AS you probably know you can create a simple OpenGL applications using WinAPI functionality only (you can create it using Microsoft Visual Studio), but if you are making somethink with real windows interface and want to create application with multiple windows/dialogs/buttons with Windows Styles etc... you can use MFC (Microsoft Foundation Classes) to do it ... But i did a 2 hours web search to find example of using OpenGL windows inside MFC created Dialog window. I found it and want to share my results now. My application is a simple OpenGL based tool, which shows OpenGL viewport on the Window. In the OpenGL viewport showed plane with reflection of sphere which rotates over it. My project uses 2 textures. You can download it here : Source files: http://mechwarrior.nm.ru/files/opengl.rarP.S. This application were created using Andre Stein's "An VC++ example that shows you how to use OpenGL n a Mfc Dialog." Internet: http://www.steinsoft.netBy the way i want to ask the question about OpenGL performance... My application takes 60% of CPU time ... Anybody knows where is problem and how to optimise it? ____________________________________________ Keeper, Sons of the Dragon http://mercenaries.net.ru
Reply
osknockout
Jun 4 2005, 10:18 PM
I would love to take a look at it, but according to your http://mechwarrior.nm.ru/files/ directory, it does not exist on the server. By the way, why would you want to use MFC with OpenGL anyway? Take a look at the majority of high-quality games out there, most of them don't even touch MFC. QUOTE By the way i want to ask the question about OpenGL performance... My application takes 60% of CPU time ... Anybody knows where is problem and how to optimise it? You are using MFC aren't you?  Sorry, but that's usually it. OpenGL performs at the same rate your program (and you) understand video card and CPU interactions, it's all software based stuff. Like all other programs, OpenGL apps have the same limits (except the video card and CPU, of course).
Reply
Keeper
Jun 7 2005, 07:28 AM
Oops i put wrong link to the source code.... Here is right one: http://mechwarrior.nm.ru/opengl.rarIt was only practical work at the univercity, but i'm interested why the hell it takes so many resources??? It's not great game to count lots of polygons... Anyway take a look and answer me what will be ur CPU time % given to my program... Best reguards... ____________________________________________ Keeper, Sons of the Dragon http://mercenaries.net.ru
Reply
dexter
Jun 7 2005, 10:33 AM
Strange, that -should- work out of the box, no? Anyway, I had to add glaux.lib to the linker's list of libs to include. It uses 99% CPU time. Though, I assume it's just using whatever it can get it's hands onto, if I did a lot of other things, it'd prolly drop down, with no performance loss. And with optimization, as long as you're using MFC, it ain't going to happen. Use pure API calls instead for more power. All I'd say MFC is good for is general apps, and even then I'd still rather not touch them. You'd think that since they're wrapper classes for the Win32 APIs, they'd be easier to use, too...
Reply
osknockout
Jun 8 2005, 12:29 PM
To think that I could port the code to Dev-C++ unscathed... well, I tried (I don't have VC++) but it failed, so I couldn't play around with the exe. Can any of you compile this without it?
Reply
dexter
Jun 9 2005, 02:43 AM
I just tried too, and failed. Although, that's because I'm missing all the MFC libs. As I understand it, the only way for you to be able to use MFC would be to build custom libs for MingW, and since no-one has access to source, it's most likely not going to happen.
Reply
iGuest
Dec 27 2007, 05:51 PM
Iam new to vc++ .While following books and starting for doing programsin 2 ways. First when choosing an MFCAppWizard(exe) and compiling filename.Cpp and build filename.Exe it always gives a error like --------------------Configuration: hello - Win32 Debug-------------------- Compiling resources... D:\MSDev98\hello\hello.Rc(11) : fatal error RC1015: cannot open include file 'afxres.H'. Error executing rc.Exe. Hello.Exe - 1 error(s), 0 warning(s) Second,Here I choose Win32 Console application --------------------Configuration: hello1 - Win32 Debug-------------------- Compiling... Error spawning cl.Exe Hello1.Exe - 1 error(s), 0 warning(s) In both ways the see++ source I wrote is #include <iostream.H> Void main() { cout<<"Hello..."; } Please anybody help me? -Radhiya
Reply
iGuest
Jul 3 2008, 07:02 AM
OpenGL MFC connection
Opengl And Mfc Dialog Based Application
Dear, Here I got a problem, I must implementing a kind of software about modeling and Image Processing. I've implemented software that have ability to catch hand movement, especially to drive a ship, so can control the direction of hand movement. When, the right hand is upper then the left hand that indicate s the direction is turn left. And vice versa. Then the second is software about OpenGL, that it is modeling of ship movement, turn left , turn right or just go trough. Both of it was implemented in MFC. My problem is how to connect two software, so when my first software catch the hand's user movement, it can modeling at screen of computer. Would some body help me?? I really appreciate it. Thanks -reply by Sarwo Edi
Reply
Recent Queries:--
c# mfc dialog based application - 0.12 hr back. (1)
-
mfc dialog based exe application - 0.27 hr back. (1)
-
mfc dialog based programing - 1.40 hr back. (1)
-
opengl mfc - 26.51 hr back. (1)
-
reflection mfc dialog - 31.85 hr back. (1)
-
mfc dialog editor - 32.87 hr back. (1)
-
opengl studio 2005 windows application - 34.81 hr back. (1)
-
glut window with mfc dialog - 38.17 hr back. (1)
-
glut inside mfc dialog - 38.40 hr back. (1)
-
opengl application cpu rate - 40.04 hr back. (1)
-
opengl in mfc - 43.20 hr back. (1)
-
opengl in mfc dialog - 47.26 hr back. (1)
-
opengl mfc picture control - 48.15 hr back. (1)
-
open gl mfc - 53.55 hr back. (1)
Similar Topics
Keywords : opengl, mfc, dialog, based, application, comments
- Opengl
(2)
Detailed C Beginner Tut
basis for learning any application programming language (2) QUOTE The best way to learn programming is to dive right in and start writing real programs.
This way, concepts which would otherwise seem abstract make sense, and the positive feedback you get
from getting even a small program to work gives you a great incentive to improve it or write the
next one. Diving in with ``real'' programs right away has another advantage, if
only pragmatic: if you're using a conventional compiler, you can't run a fragment of a
program and see what it does; nothing will run until you have a complete (if tiny or trivi....
Opengl
how to... (1) How can enable OpenGL in my C++? I mean the Borland C++, not Visual C++. What do I need other than
glut.h that I've found, and how to use it? Thanks in advance.....
Win32: Dialog Box And Accelerator
Win32 API programming (0) ok my problem is how do i make or assign a keyboard accelerator with modal dialog boxes since the
message loop is inside the function call of DailogBox() functions, unlike the modeless dialog box in
which you are the one who will create the message loop for the dialog box... is it even possible?....
Opengl Pointer To Array
Value Pointed..? (1) I'm playing around wtih openGL and trying to get the hang of c/c++(very frustrating at times). I
pass a pointer to an array from an object to my main via a get method. If I print out(cout) the
pointer(p) and the value pointed to (*p) from main, *p prints the decimal equivilent of the memory
address p, not the value that p should be pointing to. Within the object, everything is peachy, its
just when I pass the pointer to to main that this happens. The arrays plist and vlist in
meshloader are the ones im having trouble with. Any ideas? Thanks in advance. Feel free t....
Best 'c' Based Language?
(4) Hi, I have been doing C and a bit of C++ for a while now, however I am unsure where to go next or
what to concenrate on. People have told me about Visual C#, however I am not too sure how much like
C/C++ it is. I have also been told about Visual C++ but I always thought it was a Microsoft C++ IDE.
Could someone please explain the differences in all of the C variants (ojective C ), and if
possible what each ones pros and cons are. I am mainly looking into optimised windows applications.
Thanks for all of your help. ....
Program Flow
dialog problem (2) Hi, i have a quick question. I have a program that does alot of calculations near its completion.
To indicate to the user that it is still working so they dont close it I have a dialog box with a
progress bar pop up. when the dialog comes up, the regular execution of the original program stops
until I close the dialog, so I was wondering if there is a way to tell the origianl program to keep
running while the dialog is open(since the original program would be updating the progress metre).
p.s. using MFC(not by choice) Thanks alot!....
Mfc Dialog Trouble
involving listboxes (3) hi, im trying to add stuff to a listbox in a dialog called by my CDocument class ie. CODE
CMyDocument::DoSomeStuff() { CMyDialog dlg;
dlg.listbox.addString("whatever"); ******** dlg.listbox.doModal(); }
do i need to add something at the ******* to refresh my listbox because at the moment it is
appearing downright empty. i created it by making a dialog in the resource editor of vc++ .NET 2003
and then using add class wizard, and add member wizard to make the listbox an accessable control.
thanks for your time!....
Looking for opengl, mfc, dialog, based, application, comments
|
|
Searching Video's for opengl, mfc, dialog, based, application, comments
|
advertisement
|
|