Tag Archives: GLUT

Table of Contents: Learning Java Bindings for OpenGL (JOGL)

This book and the excerpts on this blog are from 2004. Obviously, the API has changed a bit since then. I provide the older information and book in the hope that it will be useful to some hobbyists.

Purchase Printed Book Learning Java Bindings for OpenGL (JOGL)

 

JSR-231 passed the Final Approval Ballot stage. Did you know Quake 2 has been ported to Java using JOGL? Here’s the website. The JOAL sound appears to be working now, and the graphics are great!. Welcome JOGL gaming!

Author’s Note (very old and unlikely needed): If you experience an “Unable to lock surface” error when running the code samples in this book, try backing out the JOGL build you are using to an April 2004 1.1 release and that should clear up your issue.

Table of Contents: Learning Java Bindings for OpenGL (JOGL)

This book describes JOGL which was approved as JSR 231 and will become the javax.media.opengl package.

-T. Gene Davis Continue reading Table of Contents: Learning Java Bindings for OpenGL (JOGL)

Appendix D: The JARs, Sources and a Brick Texture – Learning Java Bindings for OpenGL (JOGL)

This book and the excerpts on this blog are from 2004. Obviously, the API has changed a bit since then. I provide the older information and book in the hope that it will be useful to some hobbyists.

Purchase Printed Book Learning Java Bindings for OpenGL (JOGL)

 

Table of Contents: Learning Java Bindings for OpenGL (JOGL)

This book describes JOGL which was approved as JSR 231 and will become the javax.media.opengl package.

-T. Gene Davis

 

 

copyright 2004 by Gene Davis of genedavissoftware.com

Appendix D: The JARs, Sources and a Brick Texture

Where is here?

I’m assembling the source and pre-compiled classes and/or JARs here that I made for the book. Also at the bottom is
the texture I made for chapter nine. Feel free to use or modify this code, but remember it is provided on an “as is” basis.

Examples for chapter 1

ch1.zip has some very basic JOGL apps with source and classes. Also, the ‘read_me.txt’
file contains instructions for running the compiled classes. If you want
code to help you determine if JOGL is installed properly, look at the HelloWorld class and java source file.
(‘ch1.zip’ updated June 2007)

Examples for chapter 2

ch2.zip contains samples of using trig with JOGL. Both classes and source code are
included.
(‘ch2.zip’ updated June 2007)

Examples for chapter 3

ch3.zip contains several loose class files as well as the bouncing example and the dial
example code and classes.
(‘ch3.zip’ updated June 2007)

Continue reading Appendix D: The JARs, Sources and a Brick Texture – Learning Java Bindings for OpenGL (JOGL)

Chapter 1: Hello JOGL – Learning Java Bindings for OpenGL (JOGL)

This book and the excerpts on this blog are from 2004. Obviously, the API has changed a bit since then. I provide the older information and book in the hope that it will be useful to some hobbyists.

Purchase Printed Book Learning Java Bindings for OpenGL (JOGL)

 

Table of Contents: Learning Java Bindings for OpenGL (JOGL)

This book describes JOGL which was approved as JSR 231 and will become the javax.media.opengl package.

-T. Gene Davis

 

 

copyright 2004 by Gene Davis of genedavissoftware.com

Chapter 1: Hello JOGL

First There Was OpenGL

For some years now, a programmer that wanted to create a graphics intensive program that could be sold to users of different Operating Systems had one choice — OpenGL. The GL stands for Graphics Library. OpenGL is a registered trademark of SGI. OpenGL manifests itself as a cross platform C programming API. In reality though, it is a hardware-independent specification for a programming interface.

Most of the reasons that people have given me over the years for the lack of a future for Java especially in the gaming industry was that you can’t use OpenGL in Java. They rightly pointed out that the fastest 2D and 3D applications use OpenGL.

OpenGL is for making graphics. It is fast. Most of the time it is hardware accelerated. It seems that OpenGL can do anything visually that you would want to do.

Unfortunately OpenGL is written for C. Let’s face it, C is not the most popular language for programming complex applications. One of the biggest drawbacks to OpenGL is that you can’t make it do anything without a window to put your graphics in, but OpenGL doesn’t provide a means for you to create windows. This makes OpenGL hard to learn for beginners.

Luckily GLUT was introduced and made dealling with windows, buttons and events generated by users easier to add to OpenGL heavy applications. Still learning OpenGL in C or even C++ can be painful for new programmers or programmers that want to use true Object Oriented Programming.

Continue reading Chapter 1: Hello JOGL – Learning Java Bindings for OpenGL (JOGL)

OpenGL in Cocoa

copyright 2001 by T. Gene Davis

One of the exciting things about Mac OS X is its tight integration with popular cutting edge technologies. One of those technologies is OpenGL. OpenGL is a software interface that assists easy and quick development of 2D and 3D images and enviroments. It is used for modeling by engineers and some of the coolest 3D games. It can also be used for more mundane 2D endevours.

Much of a program written in c using the OpenGL interfaces can be ported as is to new platforms. Only the actual window construction and keyboard/mouse events need to be rewritten. This may be defined in a system dependent fashion. GLUT (OpenGL Utility Toolkit) fills in where OpenGL leaves off. GLUT simplifies common tasks like opening windows, listening to keyboard event, listening to mouse events and drawing useful 3D objects, and best yet, does it in a system independent manner. Mac OS X has a GLUT framework and an OpenGL framework. (Again–very cool.)

There are a few hoops to jump through to get OpenGL and GLUT working in a Cocoa application, but after those are learned it isn’t that difficult to use Cocoa for OpenGL work in general. You’ll find that any tutorial or book on OpenGL or Cocoa can take over the training from there. One restriction is that OpenGL is c not java, so if you wish to use OpenGL in a Cocoa-java app, expect to brush up on you JNI.

Continue reading OpenGL in Cocoa