Comments (8)
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Hi Andy! I'm not familiar with the Switch dev sdk, but AFAIK you should have OpenGL ES 2 support since it's a Tegra device. Addding support to Switch should be trivial, but it's not supported because it just simply never even occurred me that someone could be interested ( also i don't own a Swich and didn't even know there was an open source devkit ). But if you're getting an undefined reference error is because you're not linking against libGL or libGLES2 ( -lGL or -lGLESv2 ). I'm mostly sure that you must add -lGLESv2 to the linker flags. I don't have any knowledge about the platform but an undefined reference is just that the linker can't find the symbols of that functions, so there's not to many options. Also, if you're going to use GLES2 you need to let SOIL2 know that GLES2 is being used, addding the macro definition for it, named: SOIL_GLES2 ( -DSOIL_GLES2 ).
Regards,
Martín
from soil2.
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko).
Using -lGLESv2 solved my problem. I had been using -lEGL for my main application and assumed it would just use that.
Other than that it works just fine out of the box. At least the 1 function I tried.
Thank you for the help with my silly mistake
from soil2.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Nice to hear that! =)
from soil2.
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko).
For anyone in the future that may be reading this. Turns out the switch always reports feature unsupported even though it does support most features. You can just return 1 in this method or come up with a cleaner solution: https://bitbucket.org/SpartanJ/soil2/src/1c584821379872b5556fa750c55228964a63c67f/src/SOIL2/SOIL2.c#lines-302
from soil2.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
The Wwitch should be reporting the extensions supported by the GPU. I'm pretty sure this can be fixed the right way. Checking for the correct extensions names, they must be using other extension names that SOIL2 is not cheking. Can you send me what's the output of the GL extensions supported?
You should be able to output the extensions with something like:
#!c
typedef const GLubyte *( * pglGetStringiFunc) (unsigned int, unsigned int);
std::string getExtensions() {
std::string exts;
static pglGetStringiFunc rglGetStringiFunc = NULL;
int num_exts = 0;
int i;
if ( NULL == rglGetStringiFunc ) {
rglGetStringiFunc = (pglGetStringiFunc)SOIL_GL_GetProcAddress("glGetStringi"); // or just use eglGetProcAddress
if ( NULL == rglGetStringiFunc ) {
return 0;
}
}
#ifndef GL_NUM_EXTENSIONS
#define GL_NUM_EXTENSIONS 0x821D
#endif
glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts);
for (i = 0; i < num_exts; i++)
{
const char *thisext = (const char *) rglGetStringiFunc(GL_EXTENSIONS, i);
exts += std::string( thisext ) + " ";
}
return exts;
}
Regards
from soil2.
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko).
I can try run your code later, just heading out the door, but I'm assuming it's the same info as here: https://opengl.gpuinfo.org/displayreport.php?id=3154
That report was created by another dev so we didn't have to keep writing code to check these things.
If that's not what you need let me know and I can try your code when I get back.
Do remember I am:
-
Running through an opensource implementation of the switch API's, nothing official.
-
On an experimental emulator.
-
And it's also a console so you know ahead of time what's supported and don't really need to check anyway. I assume no actual games check.
from soil2.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Oh ok. The extensions are fine. Then if it's failing it might be a bug in the OpenGL driver. The SOIL2 implementation is just valid, if fails it must be reporting something wrong the OpenGL driver. Anyway, since this isn't nothing official, i'm not very interested in fixing it. Patchs are welcomed tho.
from soil2.
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko).
Yeah there isn't a need for a fix. If you wanted a clean fix you could just wrap the change I mentioned earlier in a
#!c
ifdef __switch__
but it's no big deal. Just figured I should mention it for future people that may want to use SOIL2 as it confused me for a bit.
Having used it for a couple days everything else seems fine. It's a nice library, much better than STBI so thank you for your work.
from soil2.
Related Issues (20)
- Unable to compile HOT 1
- weird linking errors HOT 1
- SOIL_load_OGL_cubemap returning null type HOT 5
- How do I use SOIL2 HOT 16
- install issue macOS HOT 15
- Set GL_TEXTURE_MAX_LEVEL for DDS files with incomplete mip chain
- Add arg (Int*width and int*height) to function with XXX__OGL_XXX.
- Support uwp in vcpkg
- Unable to link static lib (Android)
- compiling SOIL2 with mingw64 gcc version 11.2.0 HOT 2
- Compiler Error VS2022 HOT 5
- lib version HOT 1
- Missing documentation HOT 1
- Cannot find source file in CMake HOT 1
- invalid strcmp
- Compiler warnings (clang) HOT 1
- SOIL2 is amazing but how without OpenGL ? HOT 2
- compiling SOIL2 with mingw64 gcc version 13.1.0 in windows 11 HOT 2
- Not usable with nanovg HOT 5
- Update stb image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soil2.