Skip to Main Content
XNA 3.0 Game Programming Recipes: A Problem-Solution Approach
book

XNA 3.0 Game Programming Recipes: A Problem-Solution Approach

by Riemer Grootjans
May 2009
Intermediate to advanced content levelIntermediate to advanced
671 pages
18h 34m
English
Apress
Content preview from XNA 3.0 Game Programming Recipes: A Problem-Solution Approach
CHAPTER 5 ■ GETTING THE MOST OUT OF VERTICES
410
TextureAddressMode.Wrap
Although this is the default texture addressing mode, after using a different one you can rese-
lect wrapping using this code:
device.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
device.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
Using this addressing mode, the graphics card will keep adding or subtracting 1 from the
coordinate until it enters the [0,1] range.
Graphically,thiswillresultintheoriginaltexturebeingcopied,asshownintherightpart
of Figure 5-5.
Here are some example texture coordinate mappings:
(–0.5f,1.5f)
(0.5f,0.5f)
(1.2f,–0.2f)
(0.2f,0.8f)
(–0.7f,–1.2f)
(0.3f,0.8f)
TextureAddressMode.Mirror
Use this code to set the texture addressing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XNA 4.0 Game Development by Example: Beginner's Guide

XNA 4.0 Game Development by Example: Beginner's Guide

Kurt Jaegers
Learning LibGDX Game Development - Second Edition

Learning LibGDX Game Development - Second Edition

Suryakumar Balakrishnan Nair, Andreas Oehlke

Publisher Resources

ISBN: 9781430218555Purchase Link