{"id":15175212,"url":"https://github.com/jonatino/jogl2d","last_synced_at":"2025-10-26T10:31:13.081Z","repository":{"id":57738390,"uuid":"69714321","full_name":"jonatino/JOGL2D","owner":"jonatino","description":"Zero-overhead 2D rendering library for JOGL using Kotlin","archived":false,"fork":false,"pushed_at":"2020-01-15T04:39:31.000Z","size":248,"stargazers_count":28,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T18:14:43.795Z","etag":null,"topics":["2d","3d","development","game","gradle","graphics","java","javafx","jogl","kotlin","maven","opengl","swing","zero-overhead"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonatino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-01T02:02:54.000Z","updated_at":"2024-08-17T17:49:40.000Z","dependencies_parsed_at":"2022-08-25T20:51:50.857Z","dependency_job_id":null,"html_url":"https://github.com/jonatino/JOGL2D","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonatino%2FJOGL2D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonatino%2FJOGL2D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonatino%2FJOGL2D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonatino%2FJOGL2D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonatino","download_url":"https://codeload.github.com/jonatino/JOGL2D/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238310322,"owners_count":19450839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","3d","development","game","gradle","graphics","java","javafx","jogl","kotlin","maven","opengl","swing","zero-overhead"],"created_at":"2024-09-27T12:04:50.336Z","updated_at":"2025-10-26T10:31:12.676Z","avatar_url":"https://github.com/jonatino.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JOGL2D\n_Zero-overhead 2D rendering library for JOGL_\n\n[![Build Status](https://travis-ci.org/Jonatino/JOGL2D.svg?branch=master)](https://travis-ci.org/Jonatino/JOGL2D)\n![license](https://img.shields.io/github/license/Jonatino/JOGL2D.svg)\n\nThis library is licensed under Apache License 2.0.\n\n\nJOGL2D is an open source Kotlin library that provides easy 2D graphics rendering capabilities to JOGL without adding any overhead whatsoever (memory/CPU).\nJOGL2D is a lightweight, resource friendly, stripped down version of brandonborkholder's glg2d.\n\n# How Can I Use JOGL2D?\nSimply add JOGL2D to your JOGL application using your favourite dependancy management systems.\n\n### Gradle\n```groovy\ncompile 'org.anglur:joglext:1.0.3'\n```\n\n### Maven\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.anglur\u003c/groupId\u003e\n  \u003cartifactId\u003ejoglext\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n---\n\n\nOnce added, it is very easy to implement. Start off by making a `GLEventListener`\n```kotlin\nobject CharlatanoOverlay : GLEventListener {\n    \n    private val WINDOW_WIDTH = 500\n    private val WINDOW_HEIGHT = 500\n    private val FPS = 60\n    \n    val window = GLWindow.create(GLCapabilities(null))\n    \n    init {\n        GLProfile.initSingleton()\n    }\n    \n    fun open(width: Int = WINDOW_WIDTH, height: Int = WINDOW_HEIGHT, x: Int = 100, y: Int = 1000) {\n        val animator = FPSAnimator(window, FPS, true)\n        \n        window.addWindowListener(object : WindowAdapter() {\n            override fun windowDestroyNotify(e: WindowEvent) {\n                thread {\n                    if (animator.isStarted)\n                        animator.stop()\n                    exitProcess(0)\n                }.start()\n            }\n        })\n        \n        window.addGLEventListener(this)\n        window.setSize(width, height)\n        window.setPosition(x, y)\n        window.title = \"Hello world\"\n        window.isVisible = true\n        animator.start()\n    }\n    \n    val g = GLGraphics2D() //Create GL2D wrapper\n    \n    override fun display(gLDrawable: GLAutoDrawable) {\n        val gl2 = gLDrawable.gl.gL2\n        \n        gl2.glClear(GL.GL_COLOR_BUFFER_BIT)\n        \n        g.prePaint(gLDrawable.context) //Updated wrapper to latest glContext\n        \n        g.color = Color.RED\n        g.drawRect(0, 0, 200, 200)\n        g.color = Color.YELLOW\n        g.drawLine(0, 0, 100, 100)\n        g.color = Color.CYAN\n        g.drawString(\"OpenGL 2D Made Easy! :D\", 100, 100)\n    }\n    \n    override fun init(glDrawable: GLAutoDrawable) {\n    }\n    \n    override fun reshape(gLDrawable: GLAutoDrawable, x: Int, y: Int, width: Int, height: Int) {\n        val gl = gLDrawable.gl.gL2\n        gl.glViewport(0, 0, width, height)\n    }\n    \n    override fun dispose(gLDrawable: GLAutoDrawable) {\n        g.glDispose()\n    }\n}\n```\n\n# Screenshots\n\n![Alt text](https://dl.dropboxusercontent.com/s/08vy1wnjhdoqivn/java_2016-10-01_17-45-28.png \"Gui Demo\")\n\nHuge credits again to @brandonborkholder for open sourcing his G2D library here: https://github.com/brandonborkholder/glg2d\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonatino%2Fjogl2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonatino%2Fjogl2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonatino%2Fjogl2d/lists"}