Code Monkey home page Code Monkey logo

emscripten-sdl2-ogles2's Introduction

emscripten-sdl2-ogles2

C++/SDL2/OpenGLES2 to Javascript/WebGL using Emscripten

This project is a sample/testbed for porting C++/OpenGL graphical apps to run in the browser. The motivation for this is to preserve a bunch of old graphics demos written in C/C++. By getting these demos running in the browser and making them open source, hopefully they can live on for a very long time. This project is inspired by similar work which uses Emscripten to preserve arcade games in the browser.

Try it

Hello Triangle - Demonstrates minimal code needed, with support for mouse and touch input (see also debug version).

Why Emscripten?

Because these demos should run in the browser and porting to JS is no fun. Running an app in the browser is the ultimate convenience for the user (nothing to download and install). Better to have Emscripten do this, producing optimal Javascript/WASM, than doing the boring and error-prone work of hand porting code. Some porting work will still be necessary, but only to port into cross-platform C/C++.

Why SDL2?

Because these demos need OS event handling (keyboard, mouse, touch, text, audio, networking, etc.) and SDL provides a cross-platform library to do this. And Emscripten supports SDL.

Why OpenGLES2?

Because these demos require GPU accelerated graphics. Using the GPU in the browser requires WebGL, and OpenGLES is the path to WebGL via Emscripten.

Perhaps this project could one day grow into a library for building C/C++ graphics demos that run in the browser, but for now the goal is to preserve these old demos.

emscripten-sdl2-ogles2's People

Contributors

erik-larsen avatar mipmap avatar

Watchers

James Cloos avatar  avatar

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.