How to "blit" a bitmap into a viewport 
Author Message
 How to "blit" a bitmap into a viewport

Hi to all,

at the moment, I'm migrating my aktual game-project from DX7 to DX8.

And herein, I face a new problem.

In DX7 I could blit a background-bitmap into my backbuffer, before rendering
"on-top" of it.

So what do I do in DX8?

Is there a possibility to blit into the viewport instead of clearing it, do
I have to create a rectangle, to use my background-image as a texture or is
it still possible, to blit into the backbuffer?

--
Gr?e aus dem {*filter*}space,
mondspeer




Sat, 05 Feb 2005 01:18:15 GMT  
 How to "blit" a bitmap into a viewport
render the bitmap as a texture to a quad

draw the quad to the viewport.

--

Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://www.*-*-*.com/
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> Hi to all,

> at the moment, I'm migrating my aktual game-project from DX7 to DX8.

> And herein, I face a new problem.

> In DX7 I could blit a background-bitmap into my backbuffer, before
rendering
> "on-top" of it.

> So what do I do in DX8?

> Is there a possibility to blit into the viewport instead of clearing it,
do
> I have to create a rectangle, to use my background-image as a texture or
is
> it still possible, to blit into the backbuffer?

> --
> Gr?e aus dem {*filter*}space,
> mondspeer





Sat, 05 Feb 2005 02:26:35 GMT  
 How to "blit" a bitmap into a viewport
Hi Philip,
Hi to all,
(late response, so I sumarize: I want to have a "background-image"
filling my whole screen, before I render my 3D-linelist or stuff
"on-top" of it.


Quote:
> render the bitmap as a texture to a quad

> draw the quad to the viewport.

Did I understand that right?

I have to create a quad (using e.g. a trianglefan), and put my
background-image as a texture on it?

If so, I have to more questions:
1) Am I right to asume, that i have to use a square bitmap e.g.
256*256 for my texture? So what do I do with an original bitmap that
is 800*600?

2) How do I position my quad to make sure it fills the whole viewport?
(viewport = pi/4, x=0, y=0, Z=-10,near=1,far=200)

Greetings out of {*filter*}space.
Mondspeer

Quote:
> --

> Phil Taylor
> PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
> few more bits and bobs.
> http://www.*-*-*.com/
> This posting is provided "AS IS" with no warranties, and confers no rights.


> > Hi to all,

> > at the moment, I'm migrating my aktual game-project from DX7 to DX8.

> > And herein, I face a new problem.

> > In DX7 I could blit a background-bitmap into my backbuffer, before
>  rendering
> > "on-top" of it.

> > So what do I do in DX8?

> > Is there a possibility to blit into the viewport instead of clearing it,
>  do
> > I have to create a rectangle, to use my background-image as a texture or
>  is
> > it still possible, to blit into the backbuffer?

> > --
> > Gr?e aus dem {*filter*}space,
> > mondspeer





Mon, 21 Feb 2005 17:57:29 GMT  
 How to "blit" a bitmap into a viewport
Hi,

Depends. If your model is, say, the outside, then it may be the case that when the observer turn
around, the sun become visible, or something similar. In this case, yes, you CAN texture a set of
triangles making a far enclosure you what can be seen.

For other cases, and I didn't have to tried it yet, you can check at
http://www.*-*-*.com/ {*filter*}/tutBO.php

which should send you to an article "Drawing Large Surfaces in DirectX 8", by Jeff Smith.

Hoping it may help,
Vanderghast, Access MVP


Quote:
> Hi Philip,
> Hi to all,
> (late response, so I sumarize: I want to have a "background-image"
> filling my whole screen, before I render my 3D-linelist or stuff
> "on-top" of it.




Quote:
> > render the bitmap as a texture to a quad

> > draw the quad to the viewport.

> Did I understand that right?

> I have to create a quad (using e.g. a trianglefan), and put my
> background-image as a texture on it?

> If so, I have to more questions:
> 1) Am I right to asume, that i have to use a square bitmap e.g.
> 256*256 for my texture? So what do I do with an original bitmap that
> is 800*600?

> 2) How do I position my quad to make sure it fills the whole viewport?
> (viewport = pi/4, x=0, y=0, Z=-10,near=1,far=200)

> Greetings out of {*filter*}space.
> Mondspeer

> > --

> > Phil Taylor
> > PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
> > few more bits and bobs.
> > http://www.*-*-*.com/
> > This posting is provided "AS IS" with no warranties, and confers no rights.


> > > Hi to all,

> > > at the moment, I'm migrating my aktual game-project from DX7 to DX8.

> > > And herein, I face a new problem.

> > > In DX7 I could blit a background-bitmap into my backbuffer, before
> >  rendering
> > > "on-top" of it.

> > > So what do I do in DX8?

> > > Is there a possibility to blit into the viewport instead of clearing it,
> >  do
> > > I have to create a rectangle, to use my background-image as a texture or
> >  is
> > > it still possible, to blit into the backbuffer?

> > > --
> > > Gr?e aus dem {*filter*}space,
> > > mondspeer





Sat, 26 Feb 2005 00:19:51 GMT  
 How to "blit" a bitmap into a viewport
Wow, that is exactly what I was hoping for.
This Tutorial rocks.

(Well ... no, I didn't try it out, but it seems to bee what I was after.)

In the german newsgroup microsoft.public.de.german.entwickler.directx
someoneposted another Idea:
To build a rectangle (trianglestrip or ~fan) an to use transformed vertices
for it, using D3DFVF_XYZRHW. Then the vertecies are not transformed (neither
by world-, view- nor projection-matrix), so I could use screen-coordinates
here. Sounds good, doesn't it?

I'm going to try which method suites me best.

Thanks to all.

--
_________________________

Greetings out of {*filter*}space,
mondspeer

... and keep on going.




Quote:
> Hi,

> Depends. If your model is, say, the outside, then it may be the case that

when the observer turn
Quote:
> around, the sun become visible, or something similar. In this case, yes,

you CAN texture a set of
Quote:
> triangles making a far enclosure you what can be seen.

> For other cases, and I didn't have to tried it yet, you can check at
> http://www.*-*-*.com/ {*filter*}/tutBO.php

> which should send you to an article "Drawing Large Surfaces in DirectX 8",
by Jeff Smith.

> Hoping it may help,
> Vanderghast, Access MVP



> > Hi Philip,
> > Hi to all,
> > (late response, so I sumarize: I want to have a "background-image"
> > filling my whole screen, before I render my 3D-linelist or stuff
> > "on-top" of it.



> > > render the bitmap as a texture to a quad

> > > draw the quad to the viewport.

> > Did I understand that right?

> > I have to create a quad (using e.g. a trianglefan), and put my
> > background-image as a texture on it?

> > If so, I have to more questions:
> > 1) Am I right to asume, that i have to use a square bitmap e.g.
> > 256*256 for my texture? So what do I do with an original bitmap that
> > is 800*600?

> > 2) How do I position my quad to make sure it fills the whole viewport?
> > (viewport = pi/4, x=0, y=0, Z=-10,near=1,far=200)

> > Greetings out of {*filter*}space.
> > Mondspeer

> > > --

> > > Phil Taylor
> > > PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers,
and a
> > > few more bits and bobs.
> > > http://www.*-*-*.com/
> > > This posting is provided "AS IS" with no warranties, and confers no
rights.


> > > > Hi to all,

> > > > at the moment, I'm migrating my aktual game-project from DX7 to DX8.

> > > > And herein, I face a new problem.

> > > > In DX7 I could blit a background-bitmap into my backbuffer, before
> > >  rendering
> > > > "on-top" of it.

> > > > So what do I do in DX8?

> > > > Is there a possibility to blit into the viewport instead of clearing
it,
> > >  do
> > > > I have to create a rectangle, to use my background-image as a
texture or
> > >  is
> > > > it still possible, to blit into the backbuffer?

> > > > --
> > > > Gr?e aus dem {*filter*}space,
> > > > mondspeer





Sat, 26 Feb 2005 23:14:09 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

2. "Access/VB/Bitmap/Wave Question?"

3. "VB/ACCESS/BITMAP/WAV Question?"

4. "VB/Access/Bitmap/Wave Question?"

5. Making an icon/bitmap "disabled"

6. GetObject("","InternetExplorer.Application") fails in Excel VBA

7. SysCmd 603, "path","path"

8. Disabling "BACK"/"FORWARD" buttons

9. Loop print "VARIABLE", "VARIABLE"

10. DLL or something like "#"#ยค#"!"#

11. Disabling "BACK"/"FORWARD" buttons

12. CreateObject("Excel","//server"), MsgBox output

 

 
Powered by phpBB® Forum Software