LWJGL Tutorial 5 - Texture Loading

preview_player
Показать описание
In this tutorial I go over a basic texture loader using LWJGL. Unlike many LWJGL texture loader tutorials on the internet, this one requires only the default java libraries, as well as LWJGL of course.
Рекомендации по теме
Комментарии
Автор

Thanks a lot, the key to knowing all of this is to fully understand the OpenGL functions and the parameters you parse in, then you can start playing around with them through your own knowledge

DazKins
Автор

I'm jean baptiste brun and I love this coding video tutorial

jean-baptistebrun
Автор

No because a byte represents one colour (or two hexadecimal digits, 8 binary digits) and each pixel is made up of 3 colours Red, Green and Blue so we need 3 bytes per pixel which can be stored in an integer

DazKins
Автор

nvm fixed it :D IO problem you didn't seem to have. I did this to load texture instead.
File textureFile = new File(key);
FileInputStream stream = new FileInputStream(textureFile);
image = ImageIO.read(stream);

ReshurumMc
Автор

Hmmm... im not sure, but as long as you've got it working now

DazKins
Автор

I think this is because you haven't added the res folder to the build path as showed, but if this works for you any way then great. However do note using FileInputStreams wont work when programming browser applets

DazKins
Автор

How can I adapt this to make transparent textures work?

Skiggles
Автор

Instead of constantly putting GL11.glOrtho() - for example, just use: import static org.lwjgl.opengl.GL11.*;

And then you can just do: glOrhto() instead of GL11.glOrtho() including all of the variables like: GL_MODELVIEW

shadowgearsman
Автор

Nevermind I was still using glColor3f

hrbharry
Автор

Do you have source code? This method does not work for me.

ReshurumMc
Автор

I did add it to the build path but it still wouldn't work. :|

ReshurumMc
Автор

you shouldn't use the fixed function pipeline

DanielJamesCollier
Автор

Thank you your shared. Please upload or send to me this code.

VuTran-rbrj
Автор

My smiley which is blue turns dark green.

hrbharry