Giter Club home page Giter Club logo

Comments (8)

SpartanJ avatar SpartanJ commented on July 27, 2024

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.

SpartanJ avatar SpartanJ commented on July 27, 2024

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.

SpartanJ avatar SpartanJ commented on July 27, 2024

Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).


Nice to hear that! =)

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

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.

SpartanJ avatar SpartanJ commented on July 27, 2024

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.

SpartanJ avatar SpartanJ commented on July 27, 2024

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.

SpartanJ avatar SpartanJ commented on July 27, 2024

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.

SpartanJ avatar SpartanJ commented on July 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.