Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL Rendering Backend #1

Open
6 tasks
xeekworx opened this issue Apr 14, 2018 · 1 comment
Open
6 tasks

OpenGL Rendering Backend #1

xeekworx opened this issue Apr 14, 2018 · 1 comment

Comments

@xeekworx
Copy link
Owner

So far just SDL and NanoVG renderers exist. I would like to also have an OpenGL renderer (granted NanoVG somewhat covers that already). After this is added, eventually I'll be able to add Signed Distance Field features to the font, but those features will be ignored / unused in the SDL and NanoVG renderers.

To create a new renderer for OpenGL, look at renderer_nanovg for clues on what to do. You derive from renderer_base and make sure these functions are overridden (the top three being the most important):

  • on_create_image
  • on_destroy_image
  • on_draw_image
  • on_draw_line
  • on_draw_rect
  • on_fill_rect

If you do not implement on_draw_line, on_draw_rect, and on_fill_rect, be sure to still override those functions, but not do anything within them. The disadvantage is if I implement a feature that needs them (glyph backgrounds, underlined, or strikeout) then that feature just will not render.

@xeekworx xeekworx self-assigned this Apr 14, 2018
@xeekworx xeekworx changed the title TODO: OpenGL Rendering Backend OpenGL Rendering Backend Apr 14, 2018
@xeekworx
Copy link
Owner Author

This might also mean adding an example_opengl.cpp source file testing this renderer in the /examples folder. This file would likely be nearly identical to the example_nanovg.cpp file that already exists since NanoVG is already utilizing OpenGL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant