Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 489 times)
0 Members and 1 Guest are viewing this topic.
Offline tdegroot96

Junior Member


Projects: 1



« Posted 2012-11-07 19: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 Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


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

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

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline tdegroot96

Junior Member


Projects: 1



« Reply #2 - Posted 2012-11-07 19: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
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #3 - Posted 2012-11-07 19:25:07 »

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

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #4 - Posted 2012-11-07 19: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.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline tdegroot96

Junior Member


Projects: 1



« Reply #5 - Posted 2012-11-07 19: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

Junior Member


Projects: 1



« Reply #6 - Posted 2012-11-07 19: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.

 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (15 views)
2014-09-19 03:14:18

Dwinin (33 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (81 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (63 views)
2014-09-08 06:06:29

BurntPizza (46 views)
2014-09-07 01:13:42

Longarmx (33 views)
2014-09-07 01:12:14

Longarmx (38 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!