Category Archives: development

OpenGL VBO with Visual C++

I’ve been playing around with OpenGL (again) on both Apple and Microsoft platform and I soon found out that things are not simple in Windows (as usual).

The glGenBuffers and related functions are nowhere to be found on the default installation of the OpenGL SDK. It’s not THAT painful to get it done (if you know where to look).

First, you’ll need glext.h that you download from the OpenGL website, then you’ll need to declare and reference the functions at runtime. Something like this:

#include "glext.h"
PFNGLDELETEBUFFERSPROC glDeleteBuffers;
PFNGLGENBUFFERSPROC glGenBuffers;
PFNGLBINDBUFFERPROC glBindBuffer;
PFNGLBUFFERDATAPROC glBufferData;
PFNGLBUFFERSUBDATAPROC glBufferSubData;
PFNGLMAPBUFFERPROC glMapBuffer;
PFNGLUNMAPBUFFERPROC glUnmapBuffer;
void initGLFunctions() {
  glGenBuffers = (PFNGLGENBUFFERSPROC) wglGetProcAddress(LPCSTR("glGenBuffers"));
  glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) wglGetProcAddress(LPCSTR("glDeleteBuffers"));
  glBindBuffer = (PFNGLBINDBUFFERPROC) wglGetProcAddress(LPCSTR("glBindBuffer"));
  glBufferData = (PFNGLBUFFERDATAPROC) wglGetProcAddress(LPCSTR("glBufferData"));
  glBufferSubData = (PFNGLBUFFERSUBDATAPROC) wglGetProcAddress(LPCSTR("glBufferSubData"));
  glMapBuffer = (PFNGLMAPBUFFERPROC) wglGetProcAddress(LPCSTR("glMapBuffer"));
  glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) wglGetProcAddress(LPCSTR("glUnmapBuffer"));
  if (glGenBuffers == NULL) {
    const char *version;
    fprintf(stderr, "Cannot properly initialize extension functions!\n");
    version = (const char*)glGetString(GL_VERSION);
    fprintf(stderr, "OpenGL version:%s\n", version);
  }
}


The above code provides you everything you need to use the VBO related functions, but there are many many functions declared inside glext.h. You could create prototypes like above for any of them.

Beware the version of your graphics card driver. Microsoft default driver usually comes with support to OpenGL 1.1 version only, wich is not good enough for VBO.

Leave a comment

Eve Agent

Track your Eve Online training skills on your iPhone, iPod Touch or iPad with this app.

App Store Link

The Eve Online App was submitted to the AppStore and it’s waiting for approval, but i’m providing you all some screenshots so you can take a sneak-peek.

The App provides Local Notifications of completion skills. You don’t need any internet connection to receive the notifications, only to update your API information.

v. 1.0 (released)

v. 1.1 (waiting for approval)

Changelog:

  • List of known skills and certificates
  • UI colors consistent all around the application
  • Fixed a minor memory leak
  • Improved visuals and information displayed of the CharacterSheet
  • Fixed a bug that locked the user out if the download of the skillList returned an error
  • Fixed a bug where the corporation name of the pilot was not changed if the pilot changed corporations

v. 1.2 (in development)

coming soon…

If you have any questions or suggestions, feel free to leave a comment.

Also posted in iPhone | Leave a comment

Learning Cocoa

Book CoverSo… Are you an experienced programmer and is moving to Cocoa? For either MacOS X or iPhone OS, the Cocoa Programming: A Quick-Start Guide for Developers book from the Pragmatic Bookshelf is a great addition to your library. It’s a great deal, wich i’ve just finished reading. The eBook costs $22.00 (US Dollars).

It assumes that you already know how to code, and is moving to a new platform (in this case Cocoa). It helped me a lot (and it still does) when I came from my C/C++ background to the MacOS Cocoa + ObjectiveC. It’s a hands-on approach that leaves no gaps in the explanations.  I’ve found myself many times coming from the Apple’s official tutorials to the eBook to get some clarification on some topics. It’s great both for learning and for reference.

If you’re new to programming and is starting in a MacOS platform, you can check out the Beginning Mac Programming: Develop with Objective-C and Cocoa. I haven’t read this one, but it seems to make the same approach from the first one, except it does not assume any programming background.

In the meantime, my wishlist is available with some other options of books (and, if you want to send me a gift, those are great ones).

Also posted in Books | Tagged , , , , | Leave a comment

Convert EUC-JP to UTF-8 in Python

So… I study Japanese. I was searching for a way to convert some EUC-JP encoded files to the UTF-8 (now standard in most OSes), and I found myself stuck with no tools to do so.

Searching the web, I’ve found many language functions to convert lines, strings or chunk of bytes from one encoding to the other, but I have in my hand a plain-text file (a rather large one).

Continue reading »

Also posted in free | Tagged , , | 3 Comments

Currency Converter

Check out the online currency converter for MacOS X. It was developed on Snow Leopard and targeted to Snow Leopard users.

You can choose to work online or offline. When online, the program fetches the conversion rate from the internet and used for your conversions.
Continue reading »

Also posted in free, software | Tagged , , | Leave a comment

Online Currency Converter for MacOS

An simple online currency converter application made for MacOS 10. This simple application lets you choose an target and destination currency from a predefined list and it convert the currencies for you.
It fetches online the current convertion rate, displays it to you and the target value.

It is very simple and plain. No in-depth work. Just saves you the time to go online, search the site and do the math by yourself.

I’ll post a download link later this week.

Tagged , , | Leave a comment