Archive for the ‘Game’ Category

OpenGL glTexParameters

Wednesday, August 22nd, 2012

Silly me, I thought that whenever you bind a texture for rendering, you need to set the texture parameters at that time. Through a bit of trial and error, and a lot of reading, unless there is a need to change the texture parameters during runtime, you can set them once and forget about them at initial texture loading to the GPU. As long as this texture is valid (not been deleted by glDeleteTextures(…)), then these parameters will remain valid and associated with this texture. Of course, loading of textures should ideally be done once, at the start of the application or game’s level.

// allocate a new texture, bind it and set the initial parameters
GLuint name = 0;
glGenTextures(1,&name);
glBindTexture(GL_TEXTURE_2D,name);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
// set other texture parameters
...
// load our texture data
glTexImage2D(GL_TEXTURE_2D,...);

 

Now, when we want to render our quads (double triangle strips), we just bind our texture (assuming that textureID is value obtained from the code snippet above and saved someplace logical).

glBindTexture(GL_TEXTURE_2D,textureID);

And submit our quad information

GLfloat verticies[8] = {...}; // 4 x,y pairs
GLfloat texCoords[8] = {...}; // 4 s,t pairs
GLubyte colors[32] = {...}; // 4 r,g,b,a quartets
glVertexPointer(2,GL_FLOAT,0,verticies);
glTexCoordPointer(2,GL_FLOAT,0,texCoords);
glColorPointer(4,GL_UBYTE,0,colors);
glDrawArrays(GL_TRIANGLE_STRIP,0,4);

The less OpenGL calls you need to perform, the better your game’s performance will be. Hopefully this bit of information will help.

What’s Happening

Wednesday, June 6th, 2012

It’s been quiet on the Wooly Blog front. Too quiet.

To be honest, it is because we spend our days writing code and not writing prose. But, communication is key, and everybody wants to know their favorite Wooly company is still alive and kicking.

We have noticed that Wooly Tasks is a bit long for an update. All I can say is that a pretty nice update is in the works. What to expect:

  • New task management engine to more efficiently and reliably track and manage the tasks.
  • Printing and Twitter support (paid version only)
  • New UI layout to show the most important information quickly, and additional details when you desire them.
  • On iPad, removed hideous paper pad background. It wasn’t our finest moment.
  • iCloud integration and synching between devices (paid version only).
  • Stability enhancements (ok, we fixed some bugs).

On the Wooly Wind Chill side of things, we are looking into being able to integrate your favorite weather source for tapping into current temperatures and wind speeds. The first version will roll out with just a couple, and subsequent versions will add more.

On the contracting front. We are still helping Deep Dish Designs make their wonderful iPad Music application, DeepDish GigBook. While we can’t state specifics, we do know a new version with some very useful enhancements (do we sound a bit biased?) that both companies worked hard on putting together will come out “soon”. Current shipping version in the App Store is 1.6.2, so when you see a version number greater than that, then that “soon” time has arrived.

Speaking of iOS contracting services. If you have a funded product idea that you want Wooly Beast Software to help you bring to market, please feel free to contact us at info@woolybeastsoftware.com.

Finally, after considerable discussions with management, we have embarked on an exciting new project. In this post, we will not go into a lot of details of what it is, because there are still some things to work out at our end. However, we can say it will involve a bit of this: 

and this:   

and a whole lot of these guys:

That’s about it for now. Next installment we’ll discuss a bit more on what’s going on with our new project, and chronicle the steps up to release.