Skip to content

Mars999/regal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://raw.github.com/p3/regal/master/doc/regal.jpg

Regal

https://github.com/p3/regal

OpenGL portability layer for OpenGL 2.x, 3.x, 4.x, Core contexts and ES 2.0

Warning Regal is pre-alpha software, it is available here for evaluation and to play with the examples. Don't use it in your projects yet. You have been warned.

Goals

Regal is a portable OpenGL layer on top of existing OpenGL implementations. Compile and link an app against Regal and deploy on various OpenGL implementations including compatibility, core and ES 2.0 OpenGL contexts.

  • Portability
    Consistent OpenGL API that runs on all major platforms: Windows, Linux, Mac, iOS, and Android
  • Compatible
    Immediate mode, fixed function, GL_QUADS work everywhere, emulated as necessary.
  • Modern OpenGL API
    Direct State Access (DSA) and Vertex Array Object (VAO), emulated as necessary.
  • Open Source
    There is nothing behind the curtain. You can see what Regal is doing and change it if needed.
  • Ease of Use
    Set breakpoints on OpenGL functions. Step into the code. Inspect state.
  • Efficiency
    If it cannot be implemented efficiently in Regal, it is not universally supported. For example, tessellation support requires tessellation hardware.

Deployment

  • Most code remains unchanged.
  • Optionally #include <GL/Regal.h>
  • Link with regal32.dll, libRegal.so or libRegal.dylib

From an application developer's perspective, Regal just looks like an OpenGL implementation. You link with it instead of your platform's OpenGL library or framework, and that's really all you have to do to use Regal. The rest of your code can remain unchanged.

Features

  • Logging

    Regal supports detailed logging for development purposes.

    • Error -- Fatal and non-fatal Regal runtime errors.
    • Warning -- Non-fatal Regal warnings.
    • Info -- Informational messages.
    • App -- Application calls into Regal.
    • Driver -- Regal calls into OpenGL.
    • Internal -- Internal Regal calls.
    • Http -- HTTP traffic logging.

    Build-time configuration:

    • REGAL_LOG_ERROR
    • REGAL_LOG_WARNING
    • REGAL_LOG_INFO
    • REGAL_LOG_APP
    • REGAL_LOG_DRIVER
    • REGAL_LOG_INTERNAL
    • REGAL_LOG_HTTP
    • Debug mode: All logging supported with error, warning, info and http logging enabled.
    • Release mode: Support for application, driver and internal logging disabled by default.

    Environment variable configuration:

    • REGAL_LOG_ERROR
    • REGAL_LOG_WARNING
    • REGAL_LOG_INFO
    • REGAL_LOG_APP
    • REGAL_LOG_DRIVER
    • REGAL_LOG_INTERNAL
    • REGAL_LOG_HTTP
    • REGAL_LOG_API --- Application + Driver OpenGL logging
    • REGAL_LOG_NONE --- enable or disable all logging

    Environment variable lookup is globally disabled by defining REGAL_NO_GETENV at compile-time.

    Runtime configuration via GL_REGAL_log extension: (glEnable/glDisable/glIsEnabled)

    • GL_LOG_ERROR_REGAL
    • GL_LOG_WARNING_REGAL
    • GL_LOG_INFO_REGAL
    • GL_LOG_APP_REGAL
    • GL_LOG_DRIVER_REGAL
    • GL_LOG_INTERNAL_REGAL
    • GL_LOG_HTTP_REGAL
  • Spoofing OpenGL vendor, renderer, version and extension strings

    Build-time configuration

    • REGAL_GL_VENDOR
    • REGAL_GL_RENDERER
    • REGAL_GL_VERSION
    • REGAL_GL_EXTENSION

    Environment variable configuration:

    • REGAL_GL_VENDOR
    • REGAL_GL_RENDERER
    • REGAL_GL_VERSION
    • REGAL_GL_EXTENSION

    Environment variable lookup is globally disabled by defining REGAL_NO_GETENV at compile-time.

  • Regal OpenGL extensions

    • GL_REGAL_error_string for GLU-style GLenum to error string conversion.
    • GL_REGAL_extension_query for GLEW-style extension checking.
    • GL_REGAL_log for Regal logging configuration.

Planned Features

  • Debug label.
  • Debug output.
  • Web browser-based debugging tools.
  • Display list emulation.

Limitations

  • Incomplete implementation, so far.
  • Limited GLSL language support.
  • GL_QUADS only works in immediate mode or with DrawArrays for ES and core profiles.

About

Regal for OpenGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published