Giter Club home page Giter Club logo

fortrangl's Introduction

FortranGL

Interface to OpenGL 4.5+ using GLFW and GLEW on C side with Fortran interface routines

This is intended to be copied and modified, there are too many type requirements to really make a generalized interface with OpenGL 4.5 and beyond. The C interface routines combine a bunch of mondane calls so you don't have to define each one... just call them with an interace function.

The simplest case is the cube.f90

  • Init GLF with a window and a minium OpenGL context of 4.5

  • Compile your shader files

  • Create a vertex buffer and build a cube in it along with the indices to describe the triangles

  • Create a vertex buffer object to describe your vertex array (these are required beyond GL 3.3)

  • Create a vertex buffer object in GL to hold your vertex information

  • Use array buffer data to transfer your cube to the vertex buffer. Notes on this you need to define a Vertex type in fortrangl.f90, I should probably move this out and require it to be done locally in the application as Vertex types will differ from app to app. The default holds a position and a color.

  • Create your model / view / projection matrix and bind / load the MVP matrix to a uniform buffer object

  • Bind your vertex pointers using a descriptor string "F4F4" is used to describe a position / color vertex

  • Start you drawing loop in GLFW

  • FortranGL has detault callbacks to handle mouse / keyboard / window resize input in FortranGL.f90, these are bound in the initGLF routine so hack away and add your own.

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.