Giter Club home page Giter Club logo

glfc's People

Contributors

olliwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

glfc's Issues

Nothing happens on macOS

Hi, I am trying to use glfc on Windows and macOS with NanoVG and OpenGL 3 that is rendering to a framebuffer.

I have converted blur shader to #330 and everything works great on Windows.
On macOS I did set up the correct pixel format for gl3 and everything compiles OK including shaders, and no error is thrown, but can't make it blur the texture. I can see that my GPU is working but it seems that the blurred texture is not painted to the correct destination.

Here is my sample code:

glViewport(0, 0, surface->device_width, surface->device_height);
glClearColor(0.f, 0.f, 0.f, 0.f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

glGetIntegerv(GL_FRAMEBUFFER_BINDING, &initial_macOS_FBO); // Stash apple FBO

nvgluBindFramebuffer(surface->nvg_surface); // Begin main frame buffer update
nvgBeginFrame(ctx->vg, surface->user_width, surface->user_height, surface->scaling);

///////////
// Drawing something to the framebuffer using the NanoVG
//////////

nvgEndFrame(ctx->vg); // End main frame buffer update

glfc::GaussianBlurFilter filter;
filter.set_sigma(100);
filter.set_blur_radius(100);
filter.Render(surface->nvg_surface->texture, surface->user_width, surface->user_height, surface->scaling);

nvgluBindFramebuffer(nullptr);

nvgBeginFrame(ctx->vg, (float)surface->user_width, (float)surface->user_height, (float)surface->scaling);

NVGpaint img = nvgImagePattern(ctx->vg, 0, 0, (float)surface->user_width, (float)surface->user_height, 0, surface->nvg_surface->image, 1.0f);

nvgSave(ctx->vg);
nvgResetTransform(ctx->vg);
nvgBeginPath(ctx->vg);
nvgRect(ctx->vg, 0, 0, (float)surface->user_width, (float)surface->user_height);
nvgFillPaint(ctx->vg, img);
nvgFill(ctx->vg);
nvgRestore(ctx->vg);

#ifdef OS_MAC
glBindFramebuffer(GL_FRAMEBUFFER, initial_macOS_FBO); // restore apple FBO
#endif
nvgEndFrame(ctx->vg);

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.