Are textures actually working? I've found that doing a glEnable(GL_TEXTURE_2D) causes rendering to freeze when vertexes are drawn and glGenTextures crashes to home.
They should be. My OGG music player uses this lib with working textures. They have to be RGBA with 8 bits per color. I use GL_UNSIGNED_BYTE as the type. Also note that width and height need to be powers of two on the PICA, I think. I also recommend changing the unpack alignment using glPixelStorei to 1.Are textures actually working? I've found that doing a glEnable(GL_TEXTURE_2D) causes rendering to freeze when vertexes are drawn and glGenTextures crashes to home.
glGenTextures itself seems to crash hard (into the home menu) if the number of textures to generate is over 0x7F. glGenTextures(0x1001, texture) is what I had originally, probably should have lowered it, but is 0x80 a hard limit or a bug?They should be. My OGG music player uses this lib with working textures. They have to be RGBA with 8 bits per color. I use GL_UNSIGNED_BYTE as the type. Also note that width and height need to be powers of two on the PICA, I think. I also recommend changing the unpack alignment using glPixelStorei to 1.
It's also possible that I broke textures recently. Ill have to test when I find the time.
EDIT: if you could narrow down your issue to what functions are crashing and post that code, that'd help me help you.
It seems to be an allocation bug. I use a custom buffer that resizes itself when data exceeds its current size, which is by default 128 units (0x80) so it seems to crash on allocation, which is odd because in my Suzanne example, Suzanne is ~1500 vertices, and vertex data is stored in the same way. I'll look into fixing it ASAP.glGenTextures itself seems to crash hard (into the home menu) if the number of textures to generate is over 0x7F. glGenTextures(0x1001, texture) is what I had originally, probably should have lowered it, but is 0x80 a hard limit or a bug?
glEnable( GL_TEXTURE_2D) will cause the first glBegin (I was using GL_TRIANGLES) to hang, but not crash (some sort of loop it's stuck in?). Removing glEnable( GL_TEXTURE_2D) lets it render just a plain triangle (no actual texturing, just colors). As a test you can try adding glEnable( GL_TEXTURE_2D) to the fourth NeHe example and it will hang before drawing. It doesn't seem to be a kernel hang only because I can eject the cart and it responds.
Ah, I see. If I glBindTexture(GL_TEXTURE_2D, 0) it'll not hang, but it won't display non-textured stuff normally. In any case, I might be able to work with this I suppose, I'll have to try loading textures as I need them rather than the whole array at once.It seems to be an allocation bug. I use a custom buffer that resizes itself when data exceeds its current size, which is by default 128 units (0x80) so it seems to crash on allocation, which is odd because in my Suzanne example, Suzanne is ~1500 vertices, and vertex data is stored in the same way. I'll look into fixing it ASAP.
glEnable(GL_TEXTURE_2D) causing glBegin to hang is a bug thats on my list. It's due to the backend not having enough safety checks and then it attempts to use texture data without having a bound texture to use.
I believe I've fixed the glGenTextures issue. It seems I've overlooked a delete operator on an array when it should've been delete[]. It's still odd that vertices still worked this way but not textures. Anyways, pull the latest release from GitHub and try it again.Ah, I see. If I glBindTexture(GL_TEXTURE_2D, 0) it'll not hang, but it won't display non-textured stuff normally. In any case, I might be able to work with this I suppose, I'll have to try loading textures as I need them rather than the whole array at once.
EDIT: Seems like even when I allocate them individually, 0x7F is still a limit. Boo. If this could get fixed that would be fantastic.
Seems to have done the trick, still working on getting the textures to actually display though.I believe I've fixed the glGenTextures issue. It seems I've overlooked a delete operator on an array when it should've been delete[]. It's still odd that vertices still worked this way but not textures. Anyways, pull the latest release from GitHub and try it again.
EDIT: noticed delete[] calls destructors; commit 007c4f3 will save you a lot of headaches![]()
The reason for this is I've used a somewhat lazy approach I've learned form sf2dlib for sending just two buffer attributes to the shader instead of 3 or 4. I'll try to work out a fix with a new shader.OK, so I finally got textures to display somewhat. My first issue was that I was using BGRA (the particular program I'm porting has it's colors in that format, however it was an easy fix to move it to RGBA), apparently it just kinda goes nowhere if the source format is anything but RGBA. My second issue I found is that it's not exactly friendly with textured quads at all:
Although quads are bad practice anyhow so now I have an excuse to fix that. Just a note though to get that implementation better.
Also, vertex color information seems to be ignored on textures as well:
vs
![]()
Check my edit, it's an issue with negative texture mappings (commonly used to flip textures in some games). I flipped them the right way around and my textured quads work fine.The reason for this is I've used a somewhat lazy approach I've learned form sf2dlib for sending just two buffer attributes to the shader instead of 3 or 4. I'll try to work out a fix with a new shader.
As for the quads, I'm not sure why thats happening as I've successfully used textured quads.
I'm not sure if this is related but the driver wasn't setting texture wrapping. I've changed it to submit wrapping data and I've added glTexParameteri. Note that it won't support the mipmap operations for GL_TEXTURE_MIN_FILTER.Check my edit, it's an issue with negative texture mappings (commonly used to flip textures in some games). I flipped them the right way around and my textured quads work fine.
EDIT: Ported my mini project I made a while back! It was originally written in SDL for PC, but it doesn't do much more than render maps so porting was mostly just working out quirks and ifdefs
![]()

At the moment, no. However, you can wrap glBegin/glEnd calls into a display list then use glCallList for drawing. The implementation uses a VBO approach internally, so it should be pretty efficient for now.Great, for my current 3D projecr this appears to have everything I need. Does this have VBOs?

Option 1:How do I install this?
Copy the headers from caelina/include to <DEVKITPRO>/libctru/include
Copy libcaelina.a from caelina/lib/libcaelina.a to <DEVKITPRO>/libctru/lib
Add -lcaelina to your LIBS in Makefile.
Keep the caelina folder somewhere relative to your project directory.
Add -I<caelina include dir path> to your CFLAGS
Add <relative path to libcaelina.a> to your LIBS
(See Makefile in the example folder)
Because it is usable as a compiled library, it isn't yet complete and thus not ready for a full release, and some important features are broken or missing. There's also not enough developers currently working on 3D homebrew to warrant a need to open source. If a lot of people start developing 3D homebrews and this project reaches a certain level of maturity, then I'll consider releasing the source.Why is this closed source? There is no reason to keep it to yourself.
Because it is usable as a compiled library, it isn't yet complete and thus not ready for a full release, and some important features are broken or missing. There's also not enough developers currently working on 3D homebrew to warrant a need to open source. If a lot of people start developing 3D homebrews and this project reaches a certain level of maturity, then I'll consider releasing the source.
You have to understand that many developers stay away from closed-source library on principle, for good reasons. Having a reference implementation has nothing to do with that. Fear of malicious code (which lots of closed-source libraries are contaminated with one way or the other) is just one of the reasons, another one would be lack of customizability and lack of insight into implementation details (which is important when documentation is vague or the implementation turns out to be buggy).If some developers feel they can't trust a pre-compiled library for what ever reason, there are several other GL-like implementations with source code available.






