Solved

D3D rendering in a Static ?

Posted on 2002-03-24
13
267 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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 …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

19 Experts available now in Live!

Get 1:1 Help Now