C++ Game Library/ Engine like LWJGL in Java - java

I have been developing java games in lwjgl for quite a bit and now I want to switch to C++ for a new experience in game programming.
I read through quiet a lot of C++ Game engine/ libraries like SDL, SFML etc but I am really looking forward to something like LWJGL, where the code is similar to OpenGL native and supports OpenGL3 & above.
So is there a engine/ library like that? Or shall I just stick to Native OpenGL, I am really new to C++ Game development. ;)

SDL, SFML and Allegro all support using OpenGL directly so they're kind of like LWJGL in that regard. SFML and SDL 2 let you set the OpenGL version (Allegro only lets you use OpenGL 3.0 or no version specified at the moment). Of these, Allegro has the best documentation atm, SDL 2 the worst (SDL2 still isn't quite stable). SFMLs documentation is ok.
If you would tell us what exactly you're looking for you might get a more detailed answer.
Update: SDL2's documentation is quite usable by now, it's definitely not a reason not to use SDL2 anymore. Also, SDL2 seems to be stable.

Related

LWJGL3 and GLEW

I am trying to port this tutorial to Kotlin/Java with LWJGL3 using the "modern" OpenGL versions. I have followed this tutorial in c++, where I managed to create a coloured cube, that was rotated. Because I am not as familiar with c++, I made the decision to swap to Java/Kotlin.
I am unable to find the glewInit() function in LWJGL3 and all the other stuff around GLEW. From what I have read, with glew I can access the modern OpenGL API.
I have looked up some LWJGL3 tutorials, but I was unable to find one with the modern OpenGL syntax.
I have also read this question where, the answer seemed to me like LWJGL3 is basically GLEW for Java.
So is it true that I must access GLEW in order to write a "modern" OpenGL application? And if so, how with LWJL3? Or is LWJGL3 the replacement for GLEW in Java?
GLEW is an OpenGL function loading library. It's purpose is to allow you to access OpenGL, as provided by your implementation. This is important for programs written in C and C++, and GLEW is very much a C library.
LWJGL performs essentially the same function for Java. It also does other things that GLEW doesn't (like managing the OpenGL window, etc).
So in Java, you don't need GLEW, and can't really use it even if you did.
You should follow the hello world on the website.
Since you are using Kotlin, I have a small wrapper that improves the experience with lwjgl and glfw and might be interesting for you.
You can go up and running with a simple:
glfw.init("3.3")
val window = GlfwWindow(1280, 720, "ImGui Lwjgl OpenGL3 example").apply { init() }

3D animation with OpenGl

I have these two images
this
and this
With OpenGl I want to be a result as following
How can I do that with Blackberry or Android
Thanks a lot
If you like there is a library that might help you, its called min3d
http://code.google.com/p/min3d/
its very handy, has a lot of examples, and saves a lot of work
Reflections are typically done using a stencil buffer. Here is a tutorial on how the technique works. You won't be able to use the code though, as it is written for a deprecated version of OpenGL which doesn't match OpenGLES, so you'll need to write your own rendering code. Google provides a basic tutorial on how to use OpenGL ES, here.
If you are actually looking for a 3D engine, jMonkeyEngine is a scene graph based OpenGL engine with powerful features and good community support. It is platform independent and also supports Android >=2.2

3d game programming in Java

I recently agreed to help a friend make a game he has been working on and I decided that I would prefer to write it in Java. I am unsure what the best route is to take for 3D in Java. I have found that most everyone talks about Java 3d for 3d graphics in Java, which seems to basically be a wrapper for Directx and openGL but I have also found that Java 3d hasn't been in active development since 2008. Is it still the best thing to use or is there something with more active development that would be better. I have seen some discussion about some other APIs but Java 3d seems to have better documentation and there are some fairly decent books on 3d programming in Java that all seem to be based on Java 3d.
There are a number of options you have when writing 3D apps in Java.
JOGL is a very thin wrapper for OpenGL written in Java. Using it involves learning to program in OpenGL, which is no small undertaking. It does allow you to maximize your performance at the cost of a big increase in development time. If you happen to be familiar with OpenGL already , or need very low level functionality, this is your best choice.
Java3D is an object oriented extensions to Java that is easier to use then JOGL and has the advantage of being supported by the Java community. It's less used than some of the other solutions.
LWJGL (Lightweight Java Game Library) is a is a library for making games in Java with 2D and 3D graphics, and it also supports sound (OpenAL), and provides many useful features for games development. It's less suitable for other 3D development.
There are a number of other game engines built on LWJGL and the other libraries that provide a greater range of features than any of the others. JMonkeyEngine is probably the frontrunner of these. They will provide more functionality for you in terms of view control, animation etc.
Which book you read entirely depends on which choice you make above.
JOGL is a modern replacement under active development. It's basically just bindings to the OpenGL library.
Have a look at jMonkeyEngine and LWJGL.
jMonkeyEngine is being actively developed and it includes a complete toolkit and IDE for creating 3D graphics applications in Java.
LWJGL (Lightweight Java Game Library) is a library for making games in Java with 2D and 3D graphics, and it also supports sound (OpenAL).
A friend used Processing a while ago and found it reasonable.
I haven't checked it out in a while, but JMonkeyEngine was the best Java 3D engine around.

Qt Jambi vs JOGL for java OpenGL development?

I'm planning on writing a simple application in Java which has a basic UI with a section of OpenGL graphics. In addition to this some kind of network access is required.
Which one of these libraries should I use? What are the drawbacks and benefits of each option? I'd like the OpenGL coding be as genuine as possible, so that I could feel that I'm actually (learning) coding OpenGL. Is the surrounding UI significantly easier to code with one of the solutions? In the case of JOGL I'll propably make the UI with standard java components.
Just give some thoughts for me to thinker on, I'm not searching for the ultimate truth.
Qt Jambi is discontinued, so I would go JOGL just for this reason.
Also if your intent is just to have just a few basic controls on top of your 3d scene, I suggest you learn about IMGUI (Immediate Mode GUI) here and there.
Although it's not Java, NVIDIA made available IMGUI based widgets from which you can get inspiration.
JOGL has JMonkeyEngine .. a pretty nice game engine. I would recommend JOGL since it is pretty cross platform, soon with embedded platform implementations.

Is DirectX on Java possible?

Is there an easy way to use DirectX in Java? In particular, DirectX's video APIs.
I know that C# might be a more natural choice, but I have my devious reasons for wanting to do something so perverse.
I don't know about easy, but you could always use JNI to load the DirectX libs and invoke the methods.
Using something like Swig you could auto-generate a lot of the code.
Not sure how workable something like that would be though.
There seems to be a standard API about dealing with 3D inside Java.
It probably uses some kind of accelerating technology, may be even DirectX.
But I'm not sure about direct video support in this framework.
I create a library using BridJ (https://bridj.googlecode.com) that wrap DirectX classes, so you can use almost the same code than C++ examples.
You can find the library in https://bitbucket.org/fourthskyinteractive/directx-for-java.
Please, let me know about projects you develop.
There is a set of Direct3D bindings for Java available at http://java-direct3d.sourceforge.net/ but it seems that developement stopped in 2006 with DirectX 9.
Otherwise, there are OpenGL binding for java called JOGL.
The package that you want to investigate is the Java Media Framework (JMF). The core of it is pure Java, and per-platform "performance packs" provide acceleration via native libraries. It currently supports A/V capture and playback in a wide variety of data types as well as streaming via RTP and RTSP.
Sun's JMF home page
JMF SW/HW requirements
Minecraft is coded in Java with LWJGL, but Messiah Andrew's Renderer Wrapper converts the OpenGL to DirectX by using a modified version of the LWJGL libraries. Using these libraries, you should be able to code in LWJGL and have the game be running DirectX.
It seems that most are forgetting that JavaFX and Java3D support both DirectX and OpenGL using the best context for the machine you are on... well actually if you are on windows it attempts to load DirectX if it is newer than your OpenGL version.
I am not telling anyone to use either Java3D or JavaFX, but if you look at the source you can see how it is done.
GrepCode "good for looking for how things are implemented"
Open JavaFX "Open JavaFX project home" source
I should note that you want to look at the com.sun.prism package.
Java3D "Java3D project home" sources
I have been LEARNING development, LOL, for 20 years. Professionally for about 8 possible has never been the question, but how long, and/or is it worth it... Those are the questions.
Good luck my friend!
If you need any help I would be interested in creating a DirectX wrapper for java so
GIVE ME A SHOUT!

Categories