Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.
/ ork Public archive
forked from LarsFlaeten/ork

Ork - An OpenGL rendering kernel from Inria

License

Notifications You must be signed in to change notification settings

seanstone/ork

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ork

Introduction

Ork, for OpenGL rendering kernel, provides a C++ API on top of OpenGL, which greatly simplifies the development of 3D applications.

Example

Suppose that you want to draw a mesh in an offscreen framebuffer, with a program that uses a texture. Assuming that these objects are already created, with the OpenGL API you need something like this:

    glUseProgram(myProgram);
    glActiveTexture(GL_TEXTURE0 + myUnit);
    glBindTexture(GL_TEXTURE_2D, myTexture);
    glUniform1i(glGetUniformLocation(myProgram, "mySampler"), myUnit);
    glBindBuffer(GL_ARRAY_BUFFER, myVBO);
    glVertexAttribPointer(0, 4, GL_FLOAT, false, 16, 0);
    glEnableVertexAttribArray(0);
    glBindFramebuffer(GL_FRAMEBUFFER, myFramebuffer);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

With the Ork API you simply need two steps (and the first one does not need to be repeated before each draw, unless you want a different texture for each draw):

    myProgram->getUniformSampler("mySampler")->set(myTexture);
    myFramebuffer->draw(myProgram, *myMesh);

Building for Emscripten

    mkdir -p build
    cd build
    emconfigure cmake ..
    emmake make

About

Ork - An OpenGL rendering kernel from Inria

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.0%
  • Other 1.0%