Solved

D3D rendering in a Static ?

Posted on 2002-03-24
13
268 Views
Last Modified: 2013-12-26
Hello

I'm working on a viewer and so I want to render my world inside my MFC Dialog-Based Application
I don't want to use any DDutil.h nor a D3Dapp.
It seems that all rendering is done but , even if I created my D3D with the Hwnd of the Static I use as rendering surface...
I simply don't understand...

Please Help me !

0
Comment
Question by:madcowder
13 Comments
 
LVL 2

Expert Comment

by:kamarey
ID: 6900687
Can you explain it more?
0
 

Author Comment

by:madcowder
ID: 6901815
Ok , I'll try to explain it more :

I want to view my 3D world in my MFC Dialog based application without creating a ne window
So I use a Picture Control ( ID= ID_PREV_WINDOW) and I create my D3D device pointer(dx) using that control as a "focus window" ( rect = LPRECT of the Picture Control )

CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,GetDlgItem(ID_PREV_WINDOW)->GetSafeHwnd(),
                                  D3DCREATE_HARDWARE_VERTEXPROCESSING,
                                  &params, &lpd3ddev );

it seems that is works ( return 0 ) but I still can't view anything in my Picture Control

I you want me to explain you something more , just tell me !
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6902129
But there is quite a few things more to do for rendering to something. Have you got you coordinates right ? The rendering RECT ?

Do you have all your geometri set up? Have you created a vertex buffer?

Are you clearing you device before BeginScene?

Do you loop to render every frame?

/Joachim
0
 

Author Comment

by:madcowder
ID: 6902159
to Joachimc

Yes all my geometry is ok

Yes I clear my device  : I clear it with a blue color that doesn't appear on my static

Yes I loop my render

AS for my Rendering Rect , it may be that...
I don't know how to pass it to DirectX...
I just set the resolution that's all...

Can u tell me more about it ?
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6902175
So what you are saying is that if you do it like a normal DX app not MFC everything works?

For the width and height you set that in the D3DPRESENT_PARAMETERS d3dpp;
d3dpp.BackBufferHeight
d3dpp.BackBufferWidth

/Joachim
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6902193
And by the way why would you want to render to a picture control ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:madcowder
ID: 6902250
First
the D3D parameters are right i've already done it

Then
I want to render my world in the same window as my application
So if u have another solution to render into a small part of my application then tell me
pleazz!!!!!!
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6902270
And by the way why would you want to render to a picture control ?
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6902271
Ok, But isn't that just what you have MFC for to split the window into sub parts that you can render to ?
0
 

Author Comment

by:madcowder
ID: 6902291
Ok, I think you are right
It's just what i'm trying to do
I don't know much about MFC and a friend tell me to try to render in a Static

But if you can, tell me how to split my MFC Dialog-Based Application into sub parts I can render to ?
0
 
LVL 4

Accepted Solution

by:
joachimc earned 50 total points
ID: 6902309
You can read about the splitter in MSDN. I haven't got that one directly in my head. I usually just write for normal apps.

/Joachim
0
 

Expert Comment

by:CleanupPing
ID: 9464549
madcowder:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now