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

Window sized texture???

Started by Mike Lue Apr 20, 2002 at 7:13 PM 0 replies 150+ views
Original Post
Mike Lue
Mike Lue
I have defined a 4-vertices-quad on which I mapped a texture. Now, I want to set the size of my quad the same size as the window on which it is rendered so that my texture right stretches out to occupy the entire window area. Can someone tell me how to do that???
IndirectX
IndirectX
So do you want a window-sized texture or a window-sized quad?

If you want the first, that''s usually impossible, since texture sizes must be powers of two, and most display modes, as well as window sizes, aren''t. Besides, it''s pointless.

If you mean the second, get your window dimensions using GetClientRect, set up ortho view that covers the whole window, and draw a quad that has the same vertices as your client area -- (0,0)-(640,480), for instance.
---visit #directxdev on afternet <- not just for directx, despite the name

Topic Locked

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

Sign in to reply to this topic.