Solved

D3D rendering in a Static ?

Posted on 2002-03-24
13
271 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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

828 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