Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > DirectX > interface Display

Thread Tools Display Modes
Old 04-12-2002, 09:50 AM
Posts: n/a
Unhappy interface Display

Hi, im having bother with my interface (oo err!).

Im currently using the D3DXSprite object to display my interface and this im stretching the same border picture for most of my interface.

I have code that shows you how to load any picture as a Dx7 surface, and how to merge them onto screen, but my 3D objects are using the Mesh.DrawSubset. How can i use surfaces for the interface and the DrawSubset method?

Also, i want to use lookup tables for my cos/sin calculations. Im using radians (2xPI = 360) so i dont need to convert all the time. Im also storing the angle as a double, how can i implement the lookup tables?

An array with dimensions 0 to 628?
Reply With Quote
Old 04-13-2002, 05:51 AM
Posts: n/a

Well i now have code for dx8 that allows me to load a picture into a dx8 surface. I can put the image in the backbuffer before or after the 3D scene is rendered and that works, but i cant make the center of the surface transparent.

I need to do it this way so that it clips the 3D shapes so they dont display on top of my interface.

The f***ing backsurface just hides all my nice 3D work : (
Im using this method

Set surfPic = D3DDevice.CreateImageSurface(800, 600, D3DFMT_R5G6B5)

D3DX.LoadSurfaceFromFile _
surfBack, _
ByVal 0, _
ByVal 0, _
App.Path & "\testsurf.bmp", _
ByVal 0, _
0, _
ByVal 0

Set surfBack = D3DDevice.GetRenderTarget

Then in my render loop:

'Test suface
D3DDevice.CopyRects surfPic, ByVal 0, 0, surfBack, ByVal 0

Anyone have any ideas?
Reply With Quote
Old 04-14-2002, 08:09 PM
AndreRyan AndreRyan is offline
Join Date: Jan 2002
Posts: 489

I doubt you can without difficulty because of the ways DirectX is designed:
DirectX7=2D with 3D support
DirectX8=3D with 2D support
Reply With Quote
Old 04-15-2002, 03:17 AM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
Join Date: Mar 2001
Location: London, England
Posts: 8,037

You can do very good 2D work in DirectX 8, if you use a vertex type which is closer to the old D3D_TLVERTEX type then you can make a screen-sized rectangle out of 2 triangles made with 4 vertices. Then you can use normal 3D rendering techniques to apply the texture, transparencies, or alphablending that you need.

Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
Old 04-16-2002, 02:45 AM
Posts: n/a
Default Loads of questions.

Hi, i can do that but when i load the textures in they'll be resized to 256x256 maximum (voodoo 3). Im trying to get round this by creating my graphic at the correct size and resizing it to 64 x 64 or 128 x 128 etc... Hopefully when its stretched it wont lose too much in quality.

Im using 3D spheres for planets (seemed like a good choice : ) and i move the camera about. is there a way that i can force the geometry of the interface to be 2D, otherwise as i move the camera the interface will move out of view.

Also has anyone come up with a good way to popup a directx window and halt processing till an answer is received? I mean drawing a window not showing a vb one. Im having to use screen IDs to let me know where the user is.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..