Giter Site home page Giter Site logo

Comments (5)

natinusala avatar natinusala commented on May 22, 2024 1

Well I certainly think the issues you are having with OpenGL are out of scope. But I can help you integrare your GL stuff inside the library if you want. You have to insert your GL code after the nvgFrameEnd() call if you want to draw above the borealis UI.

I have a list of all the GL state you need to clear after ending the nvg frame and before drawing your stuff if you want.

Why did you need to change application.cpp? Keep in mind that you can use regular OpenGL, you don't need to use the nvglu functions.

Considering inputs, you might as well just use the hid sysmodule directly then.

from borealis.

natinusala avatar natinusala commented on May 22, 2024 1

Oh I see.

I'll close the issue, but we can keep the conversation going if you want

from borealis.

natinusala avatar natinusala commented on May 22, 2024

Hey, thanks for using borealis for your project!

You should create your own view, in which you draw the video using raw GL calls.

If you disable the frame pacer (using Application::setFramerate(0);), you can then assume that draw() is called as fast as possible in your view (as if it was a while true in which every loop iteration is a call to draw()).

For audio, you should use whatever is available (so audren, or you can keep SDL).

For inputs, what do you want to do? You can bind actions to the video player view, if that suits your needs.

from borealis.

H0neyBadger avatar H0neyBadger commented on May 22, 2024

Thank you a lot for these advises.
I assume that you are talking about the setDisplayFramerate function. I keep a good note of it

Basically I think about the chiaki (ps4 remote play) port.
From the application point of view it's just like an interactive video player.
My problem with controls is I need every switch's inputs to translate ps4 controller.

I planned to use nvgluCreateFramebuffer to render video.
unfortunately nanovg_gl_utils.h's symbols are not available through the borealis lib.
I had to include the following line in borealis project.

diff --git a/library/lib/application.cpp b/library/lib/application.cpp
index bfbe2ff..305a8ba 100644
--- a/library/lib/application.cpp
+++ b/library/lib/application.cpp
@@ -42,6 +42,7 @@
 #include <glm/vec4.hpp>
 #define NANOVG_GL3_IMPLEMENTATION
 #include <nanovg_gl.h>
+#include <nanovg_gl_utils.h>
 
 #ifdef __SWITCH__
 #include <switch.h>

I know that I'm doing something wrong but I don't know exactly how to do it correctly.
I m not familiar with nanovg nor low level OpenGL. That's why I'm asking good start advises.
Feel free to close this issue at any time since it might be out of borealis scope.
Thank you a lot ;-)

from borealis.

H0neyBadger avatar H0neyBadger commented on May 22, 2024

awesome the nvgEndFrame(vg); seems to do the trick!

I take any info that you have to share (I just do not what to bother you too much).

I changed the application.cpp to have nvgluCreateFramebuffer symbols in lib.
nvgluCreateFramebuffer code definition is under nanovg_gl_utils.h and NANOVG_GL3_IMPLEMENTATION.
if I import it from my project, the compiler raise method redefinition error.
if I don't, the linker raise an error for missing nvgluCreateFramebuffer definition.
but this is pointless if I do not need nvglu* anymore.

regarding inputs. the following method looks good.

    /**
      * Blocks any and all user inputs
      */
    static void blockInputs();

I will continue to use SDL2 (and change of method if I found a better solution).

thank you very much

from borealis.

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.