Git Product home page Git Product logo

mglexamples's Introduction

MglExamples

Hello. This is OpenGL glsl examples.

Setup

git clone https://github.com/mikelsv/MglExamples.git
git clone https://github.com/mikelsv/msvcore2.git

MSVS 2012 - 2022:
Open MglExamples/MglExamples.vcxproj

Copy glfw3.dll to Debug | Release.
Or run glfw_setup.bat

GCC:
cd ./MglExamples
make

Examples

Open MglExamples.cpp. Find defines section and configure it. (Uncomment for use)

// Select examples here <<<-----------------------------------------
#define MGL_EXAMPLE_TRIANGLE // Show triangle
#define MGL_EXAMPLE_TEXTURE // Show texture
#define MGL_EXAMPLE_SHADER // Show shader like shadertoy: glsl/shader.fs
#define MGL_EXAMPLE_OBJECTS // Show objects circles and lines
#define MGL_EXAMPLE_MENU // Show shader menu on Right click
#define MGL_EXAMPLE_POPUP // Show popup messages

MGL_EXAMPLE_TRIANGLE

Draw triangle. Based on MglSimpleGlslTriangle in https://github.com/mikelsv/msvcore2/blob/master/opengl/mgl_shader_simple.h

MGL_EXAMPLE_TEXTURE

Draw texture. By default load glsl/font.bin (binary version on font.png). Based on MglGlslTexture in https://github.com/mikelsv/msvcore2/blob/master/opengl/mgl_shader_simple.h

MGL_EXAMPLE_SHADER

Draw shader: glsl/shader.vs + glsl/shader.fs. Like as shadertoy.com. Based on GlslShader in Glsl.h.

MGL_EXAMPLE_OBJECTS

Draw primitives. Circles and paths. See code in MglExamples.cpp: lay.AddCircle(X, Y, DIA); Based on GlslObjects in Glsl.h.

MGL_EXAMPLE_MENU

Draw menu on Right click. Shaders: glsl/menu.vs + glsl/menu.fs. Based on MglMenu in https://github.com/mikelsv/msvcore2/blob/master/opengl/mgl_shader_gui.h

MGL_EXAMPLE_POPUP

Draw popup message. On start program. Or on Drag & Drop file to window. Shaders: glsl/popup.vs & glsl/popup.fs. Based on MglPopUp in https://github.com/mikelsv/msvcore2/blob/master/opengl/mgl_shader_gui.h

MglExamples

mglexamples's People

Contributors

mikelsv avatar

Watchers

 avatar

mglexamples's Issues

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.