Skip to content
/ gl1 Public
forked from curtastic/gl1

A tiny webGL 2D graphics library optimized for games where all the graphics are packed into 1 texture.

Notifications You must be signed in to change notification settings

leeoniya/gl1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gl1.js

A webGL 2D graphics library.

Designed and optimized for 2D web games that can fit all their graphics into 1 PNG.

Try the example: https://curtastic.com/gl/

Try the speed test with 50,000 images: https://curtastic.com/gl/speedtest.html?max=50000

Features:

  • Real time rotation, without slowdown. (meaning the same speed as not using rotation)
  • Real time semi-transparent drawing, without slowdown.
  • Real time color tinting/brightening, without slowdown.
  • Renders 50,000 moving images with real time rotation, tinting, and transparency at 60FPS on an old iPhone SE 2015.
  • Works like a regular canvas where you draw images in the order you want. When you want to remove something, simply stop drawing it.
  • You can pass in a canvas instead of a PNG, alter the pixels of your canvas, and reload it into webGL's texture quickly.
  • Supports old devices/browsers including IE11 and iOS9.
  • Only 4KB minified.
  • Fully commented code.

Does not include:

  • No hue-shift effect, blur effects, or Skew/3D effects.
  • No rotate about a point that isn't the image's center. But you can do that with your own math before passing drawX/drawY.
  • No camera object. But you can offset things yourself if you want scrolling.
  • No drawing other primitive shapes besides images and rectangles.
  • No font or svg support. But you can use bitmap fonts.

About

A tiny webGL 2D graphics library optimized for games where all the graphics are packed into 1 texture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.9%
  • HTML 29.1%