Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-30-2009, 06:03 AM   #1 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Default How to avoid OpenGL ES texture smooth?

Hi there!

I'm working with a pixel typography (standard 07_55) and I use it to show game time and game score, but when I render the screen OpenGL seems to smooth the numbers so they don't show as they should do (they are shown with soften corners and I want them to be shown in pixels just how they really are).
I'm working with entire pixels (so numbers don't draw in a float pixel position) and each number is a .png image, I'm not rescaling them and I'm wondering if there's an OpenGL option about texture smoothing that I can turn off for drawing the numbers.
Anyone can help please?

Thanks in advance!
Johanovski is offline   Reply With Quote
Old 11-30-2009, 11:28 AM   #2 (permalink)
Programming Wizard
 
slahteine's Avatar
 
Join Date: Oct 2008
Location: Northampton, MA USA
Age: 45
Posts: 193
Send a message via AIM to slahteine Send a message via Yahoo to slahteine Send a message via Skype™ to slahteine
Default

Quote:
Originally Posted by Johanovski View Post
Thanks in advance!
I think you want something like these:

Code:
//
// Don't anti-alias if min or maximizing
//
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

//
// Prevent edge pixels from bleeding
//
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
__________________
|
| I wrote ChordCalc ... A cool fretboard calculator.
|

slahteine is offline   Reply With Quote
Reply

Bookmarks

Tags
opengl es, pixel, texture

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 353
22 members and 331 guests
ADY, Dani77, Duncan C, e2applets, Grinarn, HemiMG, Herbie, JasonR, keeshux, linkmx, macquitzon216, mer10, Monstertaco, prchn4christ, Promo Dispenser, Robiwan, sebasx, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,881
Threads: 89,228
Posts: 380,760
Top Poster: BrianSlick (7,129)
Welcome to our newest member, macquitzon216
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0