Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyway to compile for Windows (or just easy access to GL calls?) #4

Open
smabie opened this issue Jan 17, 2018 · 1 comment
Open

Anyway to compile for Windows (or just easy access to GL calls?) #4

smabie opened this issue Jan 17, 2018 · 1 comment

Comments

@smabie
Copy link

smabie commented Jan 17, 2018

Hi,

Seeing that scala-native doesn't support windows, what would be the best way to provide a binary on Windows that allows the use of OpenGL calls? If all else fails, I assume there is some way to make the JS target support WebGL? Sorry if these aren't the right questions to be asking, I'm very familiar with Scala but not so familiar with graphics programming or Windows development..

@regb
Copy link
Owner

regb commented Jan 17, 2018

Hi,

SGL itself can export a jar, which only relies on AWT (and thus the JVM), so it can theoretically export games to Windows. That said, I have never tried as I'm not using Windows myself.

However, SGL does not provide access to OpenGL, it instead exports a Canvas API for 2D graphics. There are future plans to support OpenGL but it's not immediate. There are of course standard JVM bindings for OpenGL that are available.

If by binary you mean that you want a native executable (as scala-native could provide), I would say that the only option is scala-native. Unfotunately they don't yet have support for windows, and I don't know for when it is planned. I wrote some OpenGL bindings for scala-native (https://github.com/regb/scalanative-graphics-bindings) which could be handy in writing native applications with OpenGL, but they won't be able to run under Windows until scala-native supports it.

As for the js target, it should be possible to support WebGL, although this is not an immediate plan for the same reason that the JVM opengl API is not planned. There is a promising (but quite early in development) project (https://github.com/samarion/scalagl) that aims at providing a cross-platform (js, native, jvm) API of opengl in Scala, which could eventually be integrated into the SGL framework.

Hope that helps, don't hesitate if you have any more questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants