-
Notifications
You must be signed in to change notification settings - Fork 1
Minimal OpenGL Apps
Marino von Wattenwyl edited this page May 12, 2023
·
1 revision
Minimal OpenGL Apps
- The minimal OpenGL apps with different languages are in the folder apps/exercises and begin with ch*.
- To build them on different platforms see the different build instruction in this wiki.
The purpose of these OpenGL apps is:
- To help students to have a minimal OpenGL app in their language up & running.
- To help somebody to migrate an OpenGL app from one language to another, why ever this has to be done. The code in these examples is therefore as similar as it can be.
- To demonstrate how platform independent and portable OpenGL is.
- To demonstrate how easy it is to use modern (core profile) OpenGL in a specific language.
- It's not the goal to learn OpenGL or GLSL from these apps. They only draw a textured rectangle that can be rotated with the mouse. But it's done with core profile OpenGL with vertex buffer objects and two simple GLSL shaders for diffuse lighting. The biggest difference among the languages is the loading of the texture file.
- It's also not the goal to prove that it doesn't matter which language you use for big OpenGL projects. The SLProject will always remain in C++ because you can never have enough performance.
Minimal OpenGL App in C# in Visual Studio
- Open the project apps/exercises/ch09_TextureMapping_Net/ch09_TextureMapping_Net.csproj in Visual Studio
- Build & run the application.
- The app uses the OpenTK framework for OpenGL binding. The OpenTK.dll is in the project folder for simplicity. Please see the OpenTK website for further information.
Minimal OpenGL App in Java (needs improvements on OSX)
- Be sure that you checked out the GIT repository to a local drive and not to a network drive.
- The project requires the Eclipse IDE. Please download & install it first.
- The project uses JOGL for the OpenGL JNI (Java Native Interface) binding to OpenGL.
- Start Eclipse and choose any workspace you want.
- Use the menu File>Import>General>Existing Project into Workspace to import the project in the folder apps/exercises/ch09_TextureMapping_Java.
- Run the build.ant script that extracts the right jogl archives into the lib folder.
- Press F5 to refresh the project tree. You should see now the lib folder.
- Build & run the application.
- This port was done with a lot of help from Simon Spörri.
- On Mac OSX it seems to work only with Java 1.6 so far.
Minimal App in WebGL and JavaScript
- WebGL is the JavaScript binding for OpenGL ES2.
- For security reason the HTML-page that includes the WebGL HTML5 canvas needs to be called from a web server. For local development, we therefore need a simple local web server. I suggest downloading the language Python that provides such a simple web server.
- Start the python web server with: python -m http.server 8000
- I recommend the Google web browser Chrome for WebGL development.
- Open the file !TextureMapping.WebGL.html in Chrome with the URL: http://localhost:8000/TextureMapping.WebGL.html
- The Chrome browser has good development tool integrated. Look for them in the menu.