Solved

D3D rendering in a Static ?

Posted on 2002-03-24
13
269 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

778 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