Archive for the ‘Technology’ Category

OpenGL Display Lists And Sub Windows

I recently discovered after some needless frustration, that you need to declare display lists that contain model drawing information in all windows in which you wish to draw the model. For example, if I say:

glutSetWindow(main_window);
initDisplayLists();
...
void main_display()
{
   drawDisplayList();
}

It will work just fine. But if I try to do the same in a display function of the sub window it won’t draw. You need to call whatever init() function you create your models / display lists in AFTER setting the window. For example

glutSetWindow(main_window);
// do stuff

glutSetWindow(sub_window);
initDisplayLists();
...

void sub_display()
{
    drawDisplayList();
}

Hope that helps someone out there!

Compiling OpenGL on Mac OS X or Linux

Most linux distributions make it easy to compile programs using OpenGL. Other systems, however, aren’t so easy. Here are instructions on how to get it running in both platforms.

Ubuntu / Linux

  1. Make sure you install the opengl-mesa packages for opengl development. On ubuntu you can get them all with the following invocation:
    sudo apt-get install freeglut3-dev
  2. You should include the following #includes in your code referencing opengl:
    #  include <GL/gl.h>
    #  include <GL/glu.h>
    #  include <GL/glut.h>
  3. You should also have the following gcc cmdline flags in your makefile:
    gcc -o simple simple.c -lGL -lglut -lGLU

Mac OS X (tested on Snow Leopard)

  1. For this to work you will have to install gcc and Xcode, which should install all the required opengl/glut libraries. You can get it here.
  2. Now, you’ll have to alter all the #includes in your files to conform to the proper location. Change all your opengl #includes to the following:
    #  include <OpenGL/gl.h>
    #  include <OpenGL/glu.h>
    #  include <GLUT/glut.h>
  3. Additionally your gcc command line will need to contain the following flags to link, along with any others you might have:
    gcc -o simple simple.c -framework Carbon -framework OpenGL -framework GLUT

Cross Platform Compatibility

If you want your code to run on both, you need to get the Makefile and code to load the proper libraries depending on your system.

In all your OpenGL .c files, add the following header instead of your linux/mac includes:

#ifdef __APPLE__
#  include <OpenGL/gl.h>
#  include <OpenGL/glu.h>
#  include <GLUT/glut.h>
#else
#  include <GL/gl.h>
#  include <GL/glu.h>
#  include <GL/glut.h>
#endif

Then in your makefile, add the following before your build targets:

#default cmdline flags
LDFLAGS	= -lGL -lglut -lGLU
# Mac OS alternate cmdline link options
ifeq "$(OSTYPE)" "Darwin"
	LDFLAGS	= -framework Carbon -framework OpenGL -framework GLUT
endif

Series Renamer

I have been trying to gain access to an amazing application I recently came across. It’s know as Series Renamer and is a windows app that makes renaming and organizing your TV video files amazingly easy. If you are in the process of ripping your DVD collection then this makes the hassle of renaming all of those files as simple as selecting the correct show and episode.

I have contacted the project owner about helping out. It’ll be the first public open source project I’ve ever participated in.

Series Renamer Site

NES ROM Editing

So I did a presentation a couple years ago on NES Rom editting and I learned a lot about how to do some simple rom hacking and how old school cheat tools like game genie and game shark worked. Anyway I’ve decided to share the presentation I gave as well as all the resources I used. Everything is totally open. Everything I used to make the presentation below is included in the zip file and I even wrote up a quick little tool in .NET to translate text to dragon warrior tile entries. Anyway feel free to edit it as much as you’d like, but if you do anything cool with it I’d like to know so just shoot me an e-mail or leave some info in the comments.

Click here to download resources

 

 

Emulators for PSP Slim

I remember when I first heard about hacking your PSP to put custom firmware, I was totally excited about it. Mostly because I knew that my PSP would turn into not only a portable playstation, but a portable NES, SNES, Sega Genesis, Gameboy, GBA… you get the idea. So I decided to finally get a PSP, but by the time that I got one, they already had the newer models out, and I got a “Slim” PSP which was lighter and thinner than the original. “Alright I thought…It’s fine it’s just the newer model”. Unfortunately, a number of problems arise when it came to loading the CFW (Custom Firmware). Eventually I was able to load it but I was extremely disappointed to find out that many emulators didn’t work for Slim. I thought all hope was lost. I settled for some shitty NES version with bad resolution and moved on. That was until I found a thread post with a link to a pack of emulators that were completely compatible with the PSP Slim.

Yes you heard me right. All of these emulators work nearly 100% (as far as I’ve tested). The pack contains and emulator for nearly every kind console as well. I’ve included below the link to the File Planet mirror. I’ve also decided to host it here since I am not making use of all of my available bandwidth. Also, since emulators are not illegal, I’ll host as many as I want and no one can say anything about it :-p.

Known Compatibility Issues:

NES

* I’ve noticed that the NES emulator does not close smoothly, results in the PSP shutting off after you exit. Otherwise it seems to work fine.

Downloads:

Return top