Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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  
  a couple more questions  (Read 1241 times)
0 Members and 1 Guest are viewing this topic.
Offline Raloth

Senior Newbie




I love YaBB 1G - SP1!


« Posted 2003-04-09 02:38:34 »

1) I still can't get things to render properly. What is wrong with the following?

           gl.disable(GL.TEXTURE_2D);
           gl.blendFunc(GL.ONE,GL.ZERO);
           board.render(gl);
           
           gl.enable(GL.TEXTURE_2D);
           gl.blendFunc(GL.SRC_ALPHA,GL.ONE);
           gl.color3f(1.0f,1.0f,0f);
           gl.bindTexture(GL.TEXTURE_2D,textures[0]);
           gl.begin(GL.QUADS);
                 gl.texCoord2f(0,1);
                 gl.vertex2f(mouseX,mouseY);
                 gl.texCoord2f(0,0);
                 gl.vertex2f(mouseX,mouseY+16);
                 gl.texCoord2f(1,0);
                 gl.vertex2f(mouseX+16,mouseY+16);
                 gl.texCoord2f(1,1);
                 gl.vertex2f(mouseX+16,mouseY);
           gl.end();

The cursor ends up being blended with what is already on the screen. Changing the blending mode just makes it so the black transparency shows up. What am I doing wrong?

2) I would rather have my game in a window (yes I know that it is meant to be a debug mode). Is there any way to share the Windows cursor (for lack of a better description)? I.E. when the cursor reaches the edge of the Display boundries it hops out into the Windows environment.

3) What does Sys.getTimerResolution() do? Is it measured in ticks per millisecond?

Thanks for the help Smiley.
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2003-04-09 12:03:32 »

1) gl.blendFunc(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA); You will need an alpha channel for the mouse texture.

2) Tough Smiley Hack the library about yourself!

3) Ticks per second.

Cas Smiley

Offline Raloth

Senior Newbie




I love YaBB 1G - SP1!


« Reply #2 - Posted 2003-04-10 01:30:14 »

I know you can save alpha channels in a .png but I just can't get Photoshop (or any paint program for that matter) to do it. Is there some secret trick?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline darcone

Junior Member




Size matters


« Reply #3 - Posted 2003-04-10 06:04:48 »

I will now reveal the best kept secret in the history of Photoshop! Ok, be sure not to fall out of your chair now!
He he he...
I had a hard time finding the answer for that one as well, and the simple answer is this following procedure:

a) Create an image without a background layer (says itself, transparent).
b) Go to channels and add a new channel (should be R, G, B and now Alpha 1 <-- the new one)
You&acute;re all done! Save as.. and then choose PNG.
Remember to keep your texture sizes 2^n Wink
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.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (45 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

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

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

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
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!