{"id":13800510,"url":"https://github.com/regb/scalanative-graphics-bindings","last_synced_at":"2025-04-10T03:03:44.088Z","repository":{"id":41519421,"uuid":"85012583","full_name":"regb/scalanative-graphics-bindings","owner":"regb","description":"OpenGL and SDL2 bindings for Scala Native","archived":false,"fork":false,"pushed_at":"2022-08-02T14:25:12.000Z","size":479,"stargazers_count":41,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T04:35:12.548Z","etag":null,"topics":["graphics-bindings","opengl","scala","scala-library","scala-native","sdl2-bindings"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/regb.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":"2017-03-15T00:57:19.000Z","updated_at":"2025-01-09T00:35:56.000Z","dependencies_parsed_at":"2022-09-21T11:52:40.095Z","dependency_job_id":null,"html_url":"https://github.com/regb/scalanative-graphics-bindings","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fscalanative-graphics-bindings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fscalanative-graphics-bindings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fscalanative-graphics-bindings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fscalanative-graphics-bindings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regb","download_url":"https://codeload.github.com/regb/scalanative-graphics-bindings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148223,"owners_count":21055547,"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":["graphics-bindings","opengl","scala","scala-library","scala-native","sdl2-bindings"],"created_at":"2024-08-04T00:01:13.237Z","updated_at":"2025-04-10T03:03:44.041Z","avatar_url":"https://github.com/regb.png","language":"Scala","funding_links":[],"categories":["Bindings"],"sub_categories":[],"readme":"# Graphics Bindings for Scala Native\n\nThis repository hosts [Scala Native](http://scala-native.org) bindings to the\npopular graphics programming libraries SDL2 and OpenGL. With these, you can\ndevelop high-performing graphical software, such as games, in your favorite\nlanguage.\n\nThe bindings are designed to reproduce as much as possible the original\nprogramming interface in C. In particular, they won't hide Scala Native\ninteroperability types behind regular Scala types. These bindings are only\nmeant to provide access to these libraries for pure Scala Native projects. As\nsuch, they expose the low-level details of the underlying API and they might\nnot be suitable for use in platforms that are not supported by Scala Native.\nIf you are looking for a truly cross-platform solution, the\n[ScalaGL](https://github.com/samarion/scalagl) project aims to provide a\ncross-platform (Native, JS, JVM) OpenGL wrapper. Alternatively, The [Scala Game\nLibrary](http://github.com/regb/scala-game-library) is a complete 2D Scala game\nengine with cross-platform support, which uses the SDL2 and OpenGL bindings for\nits Scala Native backend implementation.\n\nTo get started, have a look at the [examples](/examples) folder containing\nrunnable demo projects. They demonstrate how to use the different librairies\nand extensions.\n\n## SDL2\n\nAdd this to your `build.sbt`:\n\n    libraryDependencies += \"com.regblanc\" %%% \"native-sdl2\" % \"0.2\"\n\nThe bindings export most of SDL2 standard functionalities. Importing\n\n    import sdl2.SDL._\n    import sdl2.Extras._\n\nis pretty much equivalent to\n\n    #include \"SDL.h\"\n\nSDL2 extensions can be provided as separate dependencies. Currently, we have an\nimplementation of `SDL2_image` and `SDL_ttf`, which can be included in your\nproject with:\n\n    libraryDependencies += \"com.regblanc\" %%% \"native-sdl2-image\" % \"0.2\"\n    libraryDependencies += \"com.regblanc\" %%% \"native-sdl2-ttf\" % \"0.2\"\n\nFor more documentation, you should refer to the official documentation of SDL,\nas the bindings maintain almost the exact same interface.\n\n## OpenGL\n\nOpenGL functions up to 4.6 are exported.\n\nAdd this to your `build.sbt`:\n\n    libraryDependencies += \"com.regblanc\" %%% \"native-opengl\" % \"0.2\"\n\nYou will also need to add an additional linking option, which will vary\ndepending on your system. For Linux, add the following to your project:\n\n      nativeLinkingOptions += \"-lGL\"\n\nAnd for OSX, add the following instead:\n\n      nativeLinkingOptions ++= Seq(\"-framework\", \"OpenGL\")\n\nThe bindings export all of the OpenGL standard up to 4.6. Importing\n\n    import opengl.GL._\n    import opengl.Extras._\n\nwill bring all of the standard functions and definitions of OpenGL.\n\nFor more documentation, you should refer to the official documentation of\nOpenGL, as the bindings maintain almost the exact same interface.\n\n## OpenGL ES\n\nComing soon..\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregb%2Fscalanative-graphics-bindings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregb%2Fscalanative-graphics-bindings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregb%2Fscalanative-graphics-bindings/lists"}