Hello,
I want to load images into my Java Game with LWJGL but I don't want to use Slick2D. Is this at all possible?
Thanks.
5 replies to this topic
#1
Posted 01 January 2012 - 10:46 AM
|
|
|
#2
Posted 01 January 2012 - 11:43 AM
Does the 2nd example from the following website accomplish this?:
embeddednode: Textures in LWJGL 2
Specifically, the "Solution in AWT."
What prevents you from using Slick2D?
embeddednode: Textures in LWJGL 2
Specifically, the "Solution in AWT."
What prevents you from using Slick2D?
#3
Posted 01 January 2012 - 12:18 PM
I just don't want to use an entirely library for loading images if I can help it. And I was convinced that LWJGL must have some method or given function for it anyway.
Also, whats with the loops like these?:
for(int i=0x00000000; i<img.data.length; i+=0x00000003) {
temp = src.data[i];
src.data[i] = src.data[i+0x00000002];
src.data[i+0x00000002] = temp;
}
Why all of the 0x00000000 st
Also, I don't know if I should know this by now or something, but why specifically AWT? I apologise if that's a dumb question.
Also, whats with the loops like these?:
for(int i=0x00000000; i<img.data.length; i+=0x00000003) {
temp = src.data[i];
src.data[i] = src.data[i+0x00000002];
src.data[i+0x00000002] = temp;
}
Why all of the 0x00000000 st
Also, I don't know if I should know this by now or something, but why specifically AWT? I apologise if that's a dumb question.
#4
Posted 01 January 2012 - 01:43 PM
I'm not sure why the loops are programmed like this. It looks to be the equivalent of:
The AWT contains 2 classes that are used to store the image data from the disk into the JVM memory, and then transfer the data into a ByteBuffer.
for(int i=0; i<img.data.length; i+=3) {
temp = src.data[i];
src.data[i] = src.data[i+2];
src.data[i+2] = temp;
}
The AWT contains 2 classes that are used to store the image data from the disk into the JVM memory, and then transfer the data into a ByteBuffer.
#5
Posted 09 January 2012 - 06:05 PM
Well you can load an image using the normal Java API by just doing
where path = the path to your image...
~baseball435
ImageIcon ic = new ImageIcon(path); Image i = ic.getImage();
where path = the path to your image...
~baseball435
#6
Posted 10 January 2012 - 05:38 PM
baseball435 said:
Well you can load an image using the normal Java API by just doing
where path = the path to your image...
~baseball435
ImageIcon ic = new ImageIcon(path); Image i = ic.getImage();
where path = the path to your image...
~baseball435
Is the AWT not considered part of the "normal" Java API?
Does ImageIcon provide the necessary information for LWJGL to map textures to polygons?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









