GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - yui0/catgl: a cross-platform 3D graphics engine

BranchesTags
Open more actions menu

Latest commit

 

History

98 Commits
98 Commits

Folders and files

NameName
Last commit message
Last commit date
android-app
android-app
 
 
fonts
fonts
 
 
nanovg
nanovg
 
 
sample
sample
 
 
README.md
README.md
 
 
catgl.h
catgl.h
 
 
catgl_android.h
catgl_android.h
 
 
catgl_android_camera.h
catgl_android_camera.h
 
 
catgl_android_camera.h.java
catgl_android_camera.h.java
 
 
catgl_android_hardware.h
catgl_android_hardware.h
 
 
catgl_glfw.h
catgl_glfw.h
 
 
catgl_obj.h
catgl_obj.h
 
 
catgl_ui.h
catgl_ui.h
 
 
catgl_ui_button.h
catgl_ui_button.h
 
 
catgl_ui_checkbox.h
catgl_ui_checkbox.h
 
 
catgl_ui_colorwheel.h
catgl_ui_colorwheel.h
 
 
catgl_ui_dropdown.h
catgl_ui_dropdown.h
 
 
catgl_ui_editbox.h
catgl_ui_editbox.h
 
 
catgl_ui_entypo.h
catgl_ui_entypo.h
 
 
catgl_ui_eyes.h
catgl_ui_eyes.h
 
 
catgl_ui_label.h
catgl_ui_label.h
 
 
catgl_ui_msgbox.h
catgl_ui_msgbox.h
 
 
catgl_ui_paragraph.h
catgl_ui_paragraph.h
 
 
catgl_ui_searchbox.h
catgl_ui_searchbox.h
 
 
catgl_ui_slider.h
catgl_ui_slider.h
 
 
catgl_ui_spinner.h
catgl_ui_spinner.h
 
 
catgl_ui_thumbnail.h
catgl_ui_thumbnail.h
 
 
catgl_ui_window.h
catgl_ui_window.h
 
 

Repository files navigation

catgl

Catgl is a cross-platform 3D graphics engine intended to be easy-to-use and high performance, which also supports the features for game development, such as animation, input device handling and sound playing. This application is designed for Android, iOS, Linux, Windows.

Technologies

  • OpenGL / OpenGLES
  • GLSL (OpenGL Shading Language)
  • NanoVG (https://github.com/memononen/nanovg)
  • stb single-file public domain libraries (https://github.com/nothings/stb)
  • GLFW (for Linux)
  • Android NDK (for Android)

Install

  • for Linux
    • dnf install glfw-devel
  • for Android
    • Download android-sdk-linux and install it.
      • tools/android update sdk
        • Android SDK Tools
        • Android SDK Platform-tools
        • Android SDK Build-tools
        • API 10 SDK Platform
        • Android Support Library
    • Download android-ndk
    • dnf install ant

Examples

  • Linux
$ cd sample/box
$ make
  • Android
$ cd sample/box
$ make android

How to use

  • Skeleton
#define CATGL_IMPLEMENTATION
#include "catgl.h"

void caInit(int width, int height)
{
}

void caRender()
{
}

void caEnd()
{
}
$ clang -std=c11 -Os -MMD -MP -Wall -Wextra -Winit-self -Wno-unused-parameter -Wno-float-equal -Wno-missing-braces -I../../ -I../../nanovg -o obj/main.o -c main.c
$ clang++ -o hello obj/main.o /lib/libglfw.so /lib/libGL.so /lib/libm.so 
  • Eyes
#define CATGL_NANOVG
#define CATGL_IMPLEMENTATION
#include "catgl.h"

struct NVGcontext* vg;
int width, height;
float pixelRatio;

int c_action, c_x, c_y;
void mouseEvent(int button, int action, int x, int y)
{
	c_action = action;
	c_x = x;
	c_y = y;
}

void caInit(int w, int h)
{
	width = w;
	height = h;
	pixelRatio = (float)width / (float)height;

	caMouseEvent = mouseEvent;

	nvgCreateEx(vg, NVG_ANTIALIAS);
}

void caRender()
{
	glViewport(0, 0, width, height);

	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);

	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glEnable(GL_CULL_FACE);
	glDisable(GL_DEPTH_TEST);

	nvgBeginFrame(vg, width, height, pixelRatio);
	static int c;
	caDrawEyes(vg, 320, 180, 640, 360, c_x, c_y, c/10);
	c++;
	nvgEndFrame(vg);
}

void caEnd()
{
	nvgDelete(vg);
}

Screenshot

Screenshot Screenshot Screenshot Screenshot Screenshot Screenshot Screenshot

About

a cross-platform 3D graphics engine

Topics

androidgraphics-enginelinuxopenglsingle-header-lib

Resources

Readme
Activity

Stars

19 stars

Watchers

3 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.