Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  new to LWJGL  (Read 6022 times)
0 Members and 1 Guest are viewing this topic.
Offline deepthought
« Posted 2010-10-18 20:11:50 »

i am thinking of switching to LWJGL and have looked at some of the examples and i'm wondering, why does it use static methods? there's nothing similiar to a glautodrawable there. what the heck?

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Spasi
« Reply #1 - Posted 2010-10-18 21:14:16 »

a) It's the natural way to do it. You can copy/paste existing C/C++ code and it will just work (with static imports). All 3 bindings in LWJGL work like this (AL/GL/CL).

b) Context management is explicit with OpenCL. With OpenGL, whenever you call a static LWJGL method it will run on the current context of the current thread. So, there's never a need to pass instances around.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2010-10-18 21:24:37 »

i am thinking of switching to LWJGL and have looked at some of the examples and i'm wondering, why does it use static methods? there's nothing similiar to a glautodrawable there. what the heck?

A lot of what JOGL added to it's 'OpenGL binding' has nothing to do with OpenGL at all, and makes little sense in procedural programming (as opposed to object oriented programming). When you look at C code, there are no abstraction layers, interfaces, threads... everything happens in your main-loop.

With LWJGL you can do exactly the same thing in Java... the way it was meant to be.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2010-10-18 21:42:35 »

I've always thought Jogl should have been implemented in two parts - the raw opengl access layer (which is basically what LWJGL does) with static functions and then the jogl-specific object layer (GLEventListener et al) layered on top of that. The fact that jogl always shoved this completely made up API down your throat has always been one of my major gripes.

Then you get newcomers who start with Jogl and think that's the only way to do it and that they 'know' opengl, when really they don't. It's almost straight out of MS's embrace-extend-extinguish tactics book. Lips Sealed

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2010-10-18 23:30:54 »

Yes, it was rather annoying wasn't it. You can implement JOGL in terms of LWJGL... but not the other way around. Well, not easily.

Cas Smiley

Offline deepthought
« Reply #5 - Posted 2010-10-19 20:24:06 »

at least that'll make porting easier. most examples are in C++ anyways.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline deepthought
« Reply #6 - Posted 2010-10-21 15:33:34 »

2 questions

i'm on a school computer and when i try anything i get a pixel format not accelerated error and all i get is a white screen. why is this?

2. how do i do vertex arrays? i've really gotta get away from fixed function

Thanks!

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #7 - Posted 2010-10-21 15:45:18 »

2 questions

i'm on a school computer and when i try anything i get a pixel format not accelerated error and all i get is a white screen. why is this?

2. how do i do vertex arrays? i've really gotta get away from fixed function

Thanks!

pixel format not accelerated just usually means that opengl driver is not available on the machine. So either the video card is too crap to run OpenGL or it needs new drivers.

As for vertex arrays, just search for a tutorial, theres plenty of tutorials out there that you can just adapt to LWJGL.
Offline deepthought
« Reply #8 - Posted 2010-10-21 15:47:31 »

Quote
pixel format not accelerated just usually means that opengl driver is not available on the machine. So either the video card is too crap to run OpenGL or it needs new drivers.


JOGL worked. and how am i supposed to install drivers with a limited account?

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #9 - Posted 2010-10-21 15:51:19 »

JOGL worked. and how am i supposed to install drivers with a limited account?
would anyone know if JOGL bundles an Opengl dll with its resources?

for the moment:
Try just using the default Display.create() without setting a DisplayMode first, also dont call setFullscreen mode.



My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #10 - Posted 2010-10-21 15:52:13 »

Could be the case that the software renderer is kicking in on JOGL.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #11 - Posted 2010-10-21 18:12:23 »

2 questions

i'm on a school computer and when i try anything i get a pixel format not accelerated error and all i get is a white screen. why is this?

2. how do i do vertex arrays? i've really gotta get away from fixed function

Thanks!

try running with -Dorg.lwjgl.opengl.Display.allowSoftwareOpenGL=true

Offline deepthought
« Reply #12 - Posted 2010-10-21 22:13:36 »

thanks! it even works on  the 800 mhz dinosaur we've got

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #13 - Posted 2010-10-22 01:14:14 »

Matzon is it possible to set this property at runtime?

In the case of a pixel format not accelerated error being caught.


edit:
nvm, I assume it already works like this, didnt see the word "allow"

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline deepthought
« Reply #14 - Posted 2010-10-22 15:29:13 »

System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL","true"); pasted into the first line of your main method will set the prop. at runtime.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline deepthought
« Reply #15 - Posted 2010-10-22 15:35:44 »

P.S. how would i load a texture from a java Graphics2D, image, or BufferedImage?
my programs will handle textures by combining them into one big giant megatexture in java2d and then loading it into opengl.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #16 - Posted 2010-10-22 15:38:41 »

P.S. how would i load a texture from a java Graphics2D, image, or BufferedImage?
my programs will handle textures by combining them into one big giant megatexture in java2d and then loading it into opengl.

Quote
the recommended way to load various texture and sound formats in LWJGL is to use the Slick-Util library (note different from Slick2D).
You can get it from http://slick.cokeandcode.com/downloads/util/ and the javadoc is located at http://slick.cokeandcode.com/javadoc-util/
Its pretty easy to use, just download the package and have a look at the examples included in the source code on how to use it.

just curious. why are you loading your textures into one megatexture? is it for performance?

If you really want to do that sort of thing, maybe LWJGL isn't for you, you could instead have a look at Slick2D, it basically has a very similar api to Java2D and has all the advatages of using LWJGL for 2d games.
Offline deepthought
« Reply #17 - Posted 2010-10-22 21:29:53 »

0. you said 2D games. i'm eventually gonna make a 3d fps
1.my game's just gonna put everything into one giant vertex array, or when i figure out how to do one, VBO. a megatexture is the best way of having all the textures available
2. did you notice i started my points off with 0 instead of 1?

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #18 - Posted 2010-10-22 21:50:05 »

Slick-utils will work for texture loading for 2d or 3d, but you probably don't want Slick2D - instead you might want to look at Ardor 3d ( http://ardor3d.com/ ) to stop you having to rewrite a whole 3d renderer yourself (unless that's what you really want of course. Smiley )

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline deepthought
« Reply #19 - Posted 2010-10-24 18:36:00 »

i actually want to write my own 3d renderer. i gotta have some challenge in computer science class after i've finished dome rediculously easy assignment

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline deepthought
« Reply #20 - Posted 2010-10-24 21:41:45 »

or should i put all the textures in one 3d texture consisting of all the textures stacked up? that might be easier than getting them to all fit together. just size it to the largest texture.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #21 - Posted 2010-10-24 21:45:08 »

Why don't you try to make it work first?

Just use a lot of textures. If it works, and is fast enough, there is nothing more to do. If the performance is too low, then put everything into the same texture.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #22 - Posted 2010-10-24 22:00:52 »

yup as they say "premature optimization is the root of all evil" Smiley
Offline gouessej
« Reply #23 - Posted 2010-10-24 22:06:20 »

thanks! it even works on  the 800 mhz dinosaur we've got
You would not have had to use software rendering if you had not used another OpenGL binding.

Slick-utils will work for texture loading for 2d or 3d, but you probably don't want Slick2D - instead you might want to look at Ardor 3d ( http://ardor3d.com/ ) to stop you having to rewrite a whole 3d renderer yourself (unless that's what you really want of course. Smiley )
Ardor3D is an excellent choice and has a proper support of both OpenGL bindings so that you can use the one you find the most reliable without using System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL","true");

Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #24 - Posted 2010-10-24 22:17:53 »

Gouessej, you were very often hammering on LWJGL-related advise in the JOGL forum.

Now we're in the LWJGL forum and it's time for you to shut up about JOGL.

Thanks!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #25 - Posted 2010-10-25 05:24:52 »

Gouessej, you were very often hammering on LWJGL-related advise in the JOGL forum.

Now we're in the LWJGL forum

Even though that was a true observation in regards to previous/current miss use of Threads.

Its always fun hearing what everyone has to say.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline deepthought
« Reply #26 - Posted 2010-10-25 21:32:35 »

it's not just performance but simplicity. it's much simpler to use 1 vertex array for all textures than to use 1 vertex array for each texture.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #27 - Posted 2010-10-25 22:01:12 »

it's not just performance but simplicity. it's much simpler to use 1 vertex array for all textures than to use 1 vertex array for each texture.

Just that the texcoords are way more complex, and you can't use GL_REPEAT / GL_WRAP.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline deepthought
« Reply #28 - Posted 2010-10-26 12:08:38 »

you can if you've got several textures stacked on top of each other in a 3d texture. there's not much use for them otherwise.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #29 - Posted 2010-10-26 15:38:38 »

3d texture performance is horrible.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Pages: [1] 2
  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.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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