Closed AntonioND closed 7 months ago
Wow that sounds really good
This is a helper to convert sizes in pixels to texture enums. For now, I haven't made more changes. https://github.com/blocksds/libnds/commit/f01c830d1f00bf7559dd60c79894a37bb311e56c
Well, this is now fully supported: https://github.com/blocksds/libnds/commit/2d947e6a6709e646c3366425a840167f2ef5e9c1
Currently,
glTexImage2D()
takes one of the values ofGL_TEXTURE_SIZE_ENUM
as input. There are two different issues to deal with:This enum isn't a typedef (most enums in
videoGL.h
are typedefs). This is quite inconsistent, but we can live with it.The simple fact that we need to provide weird defines to
glTexImage2D()
is very annoying. We should be able to pass a size in pixels and let the function do any internal handling with it as required.My proposal:
Leave the current enum as it is, for backwards compatibility.
Modify
glTexImage2D()
so that it can take both. EitherGL_TEXTURE_SIZE_ENUM
values (which go from 0 to 7) or actual sizes in pixels (powers of two between 8 to 1024 inclusive). They don't overlap, so any program that currently works with the enum values would still work with the modified function.