Skip to main content
GameDev.net gamedev.net
🔒 Locked

DX8 windowed system

Started by pagghiu Nov 19, 2000 at 2:51 PM 0 replies 250+ views
Original Post
pagghiu
pagghiu
Hi guys, i''m using directx8. Some times ago I''ve coded a simple windowed framework using DirectDraw.I had a GraphicalObj class from which i derived a GraphicalEdit, GraphicalList, GraphicalComboBox etc... Each of these classes ridefined the abstract method paint(Canvas* canvas) and used my Canvas draw functions. If in a component i made a canvas->FillRect(0,0,GetWidth(), GetHeight(),0XFFFF00); (where getwidth and height returned the dimensions of the current control) i used the x-y origin of the control to offset any drawing so this call resolved to backBuffer->FillRect(GetXPos(),GetYPos(),GetXPos()+GetWidth() etc...) Now i wanted to make the same thing work in a 3d accelerated way with DirectX8.If i use the transformed and lit vertices i can have the same behaviour (i can specify the screen coords like i did with Blt in DirectDraw,ok). But i want to go a step further. How can I render a 3D object into one of those components? How can I offset the origin of 3D axis of the render target to match the x,y origin of the 2d GraphicalObject? I think I have to move the camera but i don''t know how. The major problem is clipping.How can I tell DirectX8 to set the clipper to a RECT of the current render target? The drawings inside each paint() redefinition have to be relative to the location of the rect of the GraphicalObj. I want to do like the menu in UnrealTournament. When you select a bot on the right there is the preview of the 3d Model that is perfectly clipped in the window where it is drawn. Any ideas?
****PagghiuC++ 3D Programmingspagghiu@yahoo.it (Italy)ICQ#: 28865466****
Etnu
Etnu
All you have to do is set the viewport to the box where your model is to be drawn.

Thanks,
Etnu

Sometimes I think I know what I really don''t, but then again usually I do know what I don''t, but just don''t realize it, maybe its because I am so young, but then again it could be because I am insane.
---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.