I am trying to load sound in LWJGL 3 according to this tutorial ( http://wiki.lwjgl.org/index.php?title=OpenAL_Tutorial_1_-_Single_Static_Source ), but I found a problem that the class WaveData, which was most probably in the older version of LWJGL 2.X, is not there. There for I cant even compile the code. Is there any other way how to load sounds in lwjgl using openAL...
in LWJGL 2 I used to use paulscode sound system ( http://www.paulscode.com/forum/index.php?topic=4.0 ) but I am not sure if it works now in the newer version of LWJGL 3. Thank you for your answer :)
and if there would be any tutorial around sound in lwjgl3, could you please include the link in your answer, I tried googling theese tutorials for ages but I failed.
In a forum post it is stated:
LWJGL3 doesn't include the WaveData from LWJGL2 but it still works the same in LWJGL3, just grab it from the LWJGL2 source code and include it in your project.
So it should be safe to just copy the old WaveData class and use it with LWJGL3, because the loading algorithm and OpenAL internals have not been changed.
Recently, LWJGL included bindings for the STB library. This provides a set of utility functions for different things, like image loading, font loading and perlin noise calculation. It also has an Ogg Vorbis Decoder. Be warned however, that, like OpenGL and GLFW, STB provides only static functions instead of an object-oriented interface. It is also not very optimized.
Related
I am currently working on a small project, which shall load an image from an URL, resize and change it's colour depth to only 16 colours using a specified colour palette. The main problem for me is, that I want a program, which I can use on an Android device and on a desktop computer.
Do you know a good image processing library which works on both systems?
Thanks in advance.
There are several tools:
ImageJ, http://rsbweb.nih.gov/ij/
Fiji, http://fiji.sc/wiki/index.php/Fiji
IMMI, http://www.burgsys.com/image-processing-software-free.php
BoofCV: http://boofcv.org
The answers on this page are quite dated as of February 2014. I was searching to find a free Android image processing library and I came across the Stanford lecture notes here: http://www.stanford.edu/class/ee368/Android/index.html
Investigating a bit further, I found out that they are using OpenCV in their course material. It has a Java interface (along with many other languages), but the library is written natively in C++. They state that:
Along with well-established companies like Google, Yahoo, Microsoft,
Intel, IBM, Sony, Honda, Toyota that employ the library, there are
many startups such as Applied Minds, VideoSurf, and Zeitera, that make
extensive use of OpenCV.
I am excited(!) to have found this, looking forward to going home and giving it a go.
The Android NDK allows you to use an existing C/C++ library that does not require java.awt or any of the Android classes. For example, you could easily compile libpng as a shared library for Android and then write a JNI interface to pass images from the Java layer to the png library. Similarly, you will also be able to compile libpng as a shared library for your desktop computer and use it from there.
I recently wrote a tutorial on how to compile open-source libraries for Android. If you browse the Android source, you will find some classes that use the skia graphics library via jni. I have not used skia before, but since Android has skia in its base framework, it should not be too difficult to get it to work in your app/desktop program.
Writing cross-platform programs has been an area of active interest amongst the mobile developers community, and some engines such as libgdx have gotten really good at it. So what you are attempting is definitely possible.
Octoate,
I don't think there is a library that exists that does what you want, the reason for that is on non-mobile platform every graphical operation you are going to use in Java is going to use the Java2D rendering pipeline to some degree. On Android, this doesn't exist.
Android provides its own graphical pipeline for image manipulation and actually simplifies a lot of things that are more complicated in standard Java.
All that being said, it looks like you found a library (JJIL) that acts as an abstraction layer on top of these differences, in that case I would be a bit worried about performance and do some testing in your own code to see how it performs compared to the platform methods. For example, I saw this quote from JJIL:
allows images to be converted from Android bitmaps into JJIL RgbImages
When I look at the source for RgbImages, it looks like the image data gets converted and stored in an internal array; all of those layers of abstraction are going to cost you CPU time and memory, especially as images on mobile devices get bigger due to higher resolution cameras and high-bandwidth connections.
This may not be that big of an issue, but again, you'll probably want to do some profiling/testing/performance comparisons.
Any pure Java library should work on both platforms. A Google search of "Java image processing library" produced several results. Try to find the lightest weight lib that serves your purposes since memory and CPU are limited on mobile devices.
Barry
Is there a LWJGL port for Android available? (does not matter if the phone needs to rooted)
Things have happened since this question was answered in 2011.
It is new that LWJGL has support for Android.
The linked repo has the setup instructions and the demo, the actual code is in the LWJGL3 repo under the Android branch.
I've been using it for a while now, and this library has a bunch of useful features that aren't just connected to OpenGLES, OpenAL, OpenVR and Vulkan, but it also has a lot of utilities for things like 3D model loading, layouts, dialogs, fonts and a lot more. Meaning the Android port of LWJGL is a considerable add-on to the current OpenGL ES support.
As for other libraries though, you can use no libraries because of the native support. Alternatively, you can use LibGDX or jMonkeyEngine, those are the only two others I know of and have used. Note that these are frameworks and not libraries like LWJGL, meaning they set up a given system you have to follow (one of the reasons I dislike them). It's harder implementing custom features without having to bring out a lot of other parts of the framework that aren't that well documented.
One of LWJGL's main features is its OpenGL support. Android natively supports OpenGL ES so there's basically no need for LWJGL. As for the rest of LWJGL, it doesn't apply on the Android platform anyway - for example there is obviously no mouse to an Android device - so I don't see a direct LWJGL port ever being developed.
Check out the Android reference, especially the android.opengl package, for a good starting point.
A good 3D and 2D engine that uses LWJGL and works well for Android development (and also Desktop and Web Apps) is libGDX.
I can't say for sure, but during last autumn I was searching for quite a long time for that and couldn't find anything. So I would say no, but don't bank on that.
I'm working on a project in Java where I need to display a powerpoint presentation complete with transitions and animations. The Apache POI library provides a nice method of viewing previews of different slides statically, but it seems that any animations or transitions need to be implemented separately which, looking at the library seems to be a fair bit of work.
I've no problem with hard work - but I'm somewhat surprised if this hasn't been done already (frantic Googling however hasn't brought up any results.) Does anyone know of a Java library for powerpoint that handles animations relatively easily?
Unless someone comes up with that PowerPoint Java library for you, you might want to check out PowerPoint Object Linking and Embedding (OLE).
You can use COM4J to have almost all the classes/interface of the namespace microsoft.office.interop.powerpoint , Its almost like your using it from C#. On the code samples from the download you have the package you need with all the interface/classes implemented for you.
Hope it helps you out :P
I am looking for OpenCV java bindings, all the references point to the processing library. I know processing is java but isn't there a standalone java lib? or should just use processing libs?
I have just found this, a java wrapper of OpenCV :
https://github.com/bytedeco/javacv
Not tested, but I would love to have your point of view about this.
JavaCV is Java wrapper of OpenCV : https://github.com/bytedeco/javacv
Here is good tutorial on eclipse project configuration for JavaCV
And few applications using JavaCV is also posted there.
OpenCV now has an official Desktop Java port. It is still a work-in-progress and you have to compile opencv, but you should definitely take a look as it will be much friendly than JavaCV.
Take a look at these links for information:
http://answers.opencv.org/question/2137/wrapping-opencv-with-desktop-java-building-for-64/
And this:
http://code.opencv.org/projects/opencv/repository/revisions/fe0d07ae53ba9e6dcd1e470165ed0a85cbfce006
UPDATE (Fev 2013):
Java bindings have been released.
javacv looks pretty good, works with my webcam and images in a custom format. I'm just still looking for a possibility to performant create an IplImage from an array of floats.
I found this forum post where people are attempting pretty much the same thing:
http://nuigroup.com/forums/viewthread/3531/#44302
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!