Giter Site home page Giter Site logo

Comments (8)

wolfgangmauer avatar wolfgangmauer commented on May 8, 2024

And no default display for all :-)

` IntPtr defaultDisplay = new IntPtr (DEFAULT_DISPLAY);
// Support for BCM VideoCore API
if (IsAvailable && Bcm.IsAvailable) {
// This need to be executed before any EGL/GL routine
Bcm.bcm_host_init();
}

		// Support for Vu+ Duo2 BCM VideoCore API
		if (IsAvailable && VuDuo2.IsAvailable) {
			// This need to be executed before any EGL/GL routine
			defaultDisplay = VuDuo2.gles_init();
		}

#if DEBUG
string envEglInit = Environment.GetEnvironmentVariable("EGL_INIT");

		if (envEglInit != null && envEglInit == "NO")
			return;

#endif

		// Get EGL information
		if (IsAvailable) {
			IntPtr eglDisplay = GetDisplay(defaultDisplay);

`

from opengl.net.

wolfgangmauer avatar wolfgangmauer commented on May 8, 2024

Ups

from opengl.net.

luca-piccioni avatar luca-piccioni commented on May 8, 2024

VuDuo2.gles_init() returned value is a display handle? Then, it should be passed to DeviceContext.Create. Sadly, the display is got using eglGetDisplay with EGL_DEFAULT_DISPLAY; the returned value isn't suitable for your case?

It seems that you need optional EGL initialization. Isn't it?

Why don't you fork, so you can show your code in a better way?

from opengl.net.

wolfgangmauer avatar wolfgangmauer commented on May 8, 2024

But this seems to be a chicken/egg problem.
I have 3 extern Methods.
First of all and only once GLES_Native_Init()
GLES_Native_CreateNativeDisplay -> gives the value for eglGetDisplay(....)
GLES_Native_CreateNativeWindow -> gives the native window

Sorry, but all my test i do with Mono.Cairo, because it's hard to test with embedded system like i have.
The snippet is just like it can be...
If the getDisplay in the Initialize always use a "DEFAULT_DISPLAY" i cannot use it.

from opengl.net.

wolfgangmauer avatar wolfgangmauer commented on May 8, 2024

And i get a little confused with the naming..
A lot of devices have a "BCM VideoCore GPU", not just the Pi ;-)

from opengl.net.

luca-piccioni avatar luca-piccioni commented on May 8, 2024

Can you elaborate more about the naming? Did you intend the Bcm wrapper class?

from opengl.net.

wolfgangmauer avatar wolfgangmauer commented on May 8, 2024

Just name the classes like the device, not as the chipset.
PI->bcm->videocore
Vuplus duo2->bcm->videocore
Vuplus 4k ->bcm->videocore
so how should be the classnames for the other devices?

from opengl.net.

luca-piccioni avatar luca-piccioni commented on May 8, 2024

Well, now that EGL can be initialized by hooking the KhronosApi.EglInitializing event, every platform can initialize EGL with any native function, without including any P/Invoke declaration. Indeed I think that Bcm wrapper will be moved in OpenGL.Net.VideoCore.

The naming of OpenGL.Net.VideoCore is originated by the fact that on RPi you must use the Video Core IV (4) API (VC4? VIV?), containing a libbcmhost.so binary. Indeed Bcm wrapper, and "window" exposed in OpenGL.Net.VideoCore. This is not an API change, since Bcm is internal.

If you want to pull some code on repository, to add support to specific platforms, I see a single OpenGL.Net.Bcm library project, that is able to support multiple hardware; this project could be the OpenGL.Net.VideoCore renamed. It will contains a Raspberry class that is the actual Bcm; and it will contains a VuplusDuo2 and Vuplus4k classes that are the KhronosApi implementation for the relative platforms. If VuplusDuo2 and Vuplus4k have the very same API, that can be simplified in a single Vuplus class. Indeed, the window implementation uses a factory pattern to support multiple implementation on different platforms.

However, I don't understand why naming a software layer VideoCore and not having a standard API. 😞

from opengl.net.

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.