[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

D3D rendering in a Static ?

Posted on 2002-03-24
13
Medium Priority
?
276 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
12 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

864 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