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 (537)
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  
  Newbie Question on Textures and OpenGL  (Read 2082 times)
0 Members and 1 Guest are viewing this topic.
Offline nech_neb

Junior Member




Java for LIFE !!!


« Posted 2003-06-01 19:19:34 »

Hi all,

I'm trying to teach myself OpenGL under the Java
platform. And I'm having alot of problems making
past the initial stages of the learning curve.

I was wondering if I can get some advice.

There are 3 OpenGL interfaces I'm using as examples
right now

- SWT OpenGL package
- LWJGL pacakge
- gl4java package (Nene's examples)

I'm looking at the example source code for
all three and I'm getting really confused...

Especially with the Textures.
I was wondering if anyone can point to a
"Dummies' guide to OpenGL Textures" tutorial or
something.

Some Questions:
Of those examples mentioned about, do the
texture loading code only work with png files?
Does loading different formats require somesort of
conversion? If someone can point of to loading textures
of different formats that'd be great!!

I keep getting a Coordinate out of bounds! exception
when I try and use different files with the LWJGL TextureMapping Example.

Anyways, I'm pretty lost....
I'm looking at the Nene tutorials, but the way they
load the texture is very different then the LWJGL and
SWT examples....

Also, what are some advantages and disadvantages
of the 3 types of OpenGL packages ??

Anyways, Any help will be greatly appreciated.
Much thanks in advance.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2003-06-01 21:40:29 »

Are you using the lwjgl NeHe tutorials? - if not, go here:
http://chman-area.tuxfamily.org/

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2003-06-01 21:56:45 »

The pros and cons of each package:

SWT OpenGL
Didn't know there as a binding! So can't help much on it.

LWJGL
Pros: about as fast as it is possible to get with Java.
Comes with OpenAL and also an input library too.
And a hires timer and some maths ops.
No dependency whatsoever on AWT.
We're here to answer questions although with any luck we'll move the bulk of it to puppygames Smiley
Cons: scary pseudo-pointer stuff helps you on your way to crashes and unexpected behaviour galore.
Deliberately designed for writing fullscreen games and nothing else - you're only allowed one window, and it's probably a fullscreen one at that. You have to do everything else yourself.

GL4Java
Pros: Properly integrated with AWT - use multiple windows, mix with AWT components, etc.
Uses buffers and none of that nasty pointer stuff
Nice install.
Cons: Rumoured to have died a bit.
Relies on AWT being present hence encumbered with some bloat.
Not quite as fast as LWJGL but in percentage terms that's irrelevant.

Cas Smiley



Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nech_neb

Junior Member




Java for LIFE !!!


« Reply #3 - Posted 2003-06-02 00:25:36 »

I'm also having some problems with the Texture tutorial.
I don't understand... how come if I take the same
tutorial, and I replace the picture with a different picture.
I don't get the desired result?

I can a white blank texture rather than the picture I
replaced with....

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2003-06-02 01:03:28 »

Probably coz you did it wrong Wink
More details please!

Cas Smiley

Offline tom
« Reply #5 - Posted 2003-06-02 09:50:51 »

Quote
I'm also having some problems with the Texture tutorial.
I don't understand... how come if I take the same
tutorial, and I replace the picture with a different picture.
I don't get the desired result?


Remember that the size of the textures must be power of two. Meaning the width and height must be one of the following: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 etc.

Offline PlanetMongo

Senior Newbie




Follow the yellow line.  Don't EAT the yellow line


« Reply #6 - Posted 2003-06-03 15:46:30 »

Which would be better for taking away *from* java in terms of learning?  Like, if I wanted to switch to C++ OpenGL development, wouldn't LWJGL be a better choice for keeping "shit straight"?
(just curious)

If you were me, you'd be good lookin - six string samurai
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #7 - Posted 2003-06-03 15:52:13 »

Quote
Which would be better for taking away *from* java in terms of learning?

And what should we do? - cut the texture, draw weird stuff or crash the VM? - your choice...

Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #8 - Posted 2003-06-03 17:57:33 »

nech_neb: Yeah, what Tom said!  A missing texture usually means the texture dimensions aren't powers of two.  You can either stretch/squash the image or pad it out, and then fix it with modified texture coordinates.

Brian: Having a bad day? Grin

PlanetMongo: OpenGL is OpenGL.  What you learn of the core libraries will be the same in LWJGL, GL4Java and in the C/C++ OpenGL bindings.  However, big differences will appear in things like input handling, image loading and context creation.  But all the core functionality will be the same.  Innit great? Cool

Hellomynameis Charlie Dobbie.
Offline PlanetMongo

Senior Newbie




Follow the yellow line.  Don't EAT the yellow line


« Reply #9 - Posted 2003-06-03 19:02:14 »

Ahh.. My bad.  I was under the impression that gl4java "hid" the OpenGL calls..  My question might have been a bit misworded or misconstrued in that I was wondering which (lwjgl, gl4java) would be a better tool for learning OpenGL for usage in other languages (like, C++), if necessary.  I have come to the conclusion that LWJGL fits that a bit better (as there's no getting around pointers in C++, might as well get sorta used to them now, right?).

If you were me, you'd be good lookin - six string samurai
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 (16 views)
2014-08-01 22:53:16

CogWheelz (15 views)
2014-08-01 22:51:43

CopyableCougar4 (18 views)
2014-08-01 19:37:19

CogWheelz (19 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 (42 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
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

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

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
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!