Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (405)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [FIXED] Disable glColor  (Read 258 times)
0 Members and 1 Guest are viewing this topic.
Offline tdegroot96

Senior Newbie





« Posted 2012-11-07 20:10:30 »

I am currently using a basic text drawing method, which pretty works. I set the color of drawing to white. Now all my textures I use, will have white spaces in the transparancy. How can I disable the color I set?
Source: https://github.com/Desmaster/Devio/blob/master/src/com/github/desmaster/Devio/Devio.java
Offline matheus23

JGO Wizard


Medals: 72
Projects: 3


You think about my Avatar right now!


« Reply #1 - Posted 2012-11-07 20:12:25 »

Call glColor with (1, 1, 1) again.

Take a look at my development Blog: http://matheusdev.tumblr.com
Also look at my RPG Ruins of Revenge
Offline tdegroot96

Senior Newbie





« Reply #2 - Posted 2012-11-07 20:15:09 »

That will give me this result: http://gyazo.com/cb93b18a1456f6e6c7f6d7ec95dda5ca
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online RobinB
« Reply #3 - Posted 2012-11-07 20:25:07 »

My guess would be its not glColor, but glBlendfunc.
Do you change the blending when drawing text?
Offline matheus23

JGO Wizard


Medals: 72
Projects: 3


You think about my Avatar right now!


« Reply #4 - Posted 2012-11-07 20:28:46 »

Yes. He needs to call

1  
2  
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


before drawing sprites again.
Also, you need to draw the things with alpha in it before drawing the stuff without alpha.

Take a look at my development Blog: http://matheusdev.tumblr.com
Also look at my RPG Ruins of Revenge
Offline tdegroot96

Senior Newbie





« Reply #5 - Posted 2012-11-07 20:29:27 »

Yes, I disable the blending with glDisable(GL11.GL_BLEND); first, after the drawing I enable it by glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Offline tdegroot96

Senior Newbie





« Reply #6 - Posted 2012-11-07 20:33:09 »

Yes I got it fixed! Thanks guys! Smiley
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (60 views)
2013-05-17 21:29:12

alaslipknot (69 views)
2013-05-16 21:24:48

gouessej (99 views)
2013-05-16 00:53:38

gouessej (96 views)
2013-05-16 00:17:58

theagentd (107 views)
2013-05-15 15:01:13

theagentd (98 views)
2013-05-15 15:00:54

StreetDoggy (144 views)
2013-05-14 15:56:26

kutucuk (166 views)
2013-05-12 17:10:36

kutucuk (165 views)
2013-05-12 15:36:09

UnluckyDevil (175 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.067 seconds with 21 queries.