Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Adhemar
Jan 21, 2004

Kellner, da ist ein scheussliches Biest in meiner Suppe.

dsage posted:

How would you get around having opengl textures that are not 64, 128, or 256 pixels in width/height?

Do you need to support an older spec? OpenGL 2.0+ supports non power-of-two textures natively. Otherwise, yeah, what krysmopompas said.

Adbot
ADBOT LOVES YOU

forelle
Oct 9, 2004

Two fine trout
Nap Ghost

vanjalolz posted:

I hear that NeHe is bad, but there is a LOT more stuff on there than Nate's website.

I really really don't get the NeHe hate. Ok, it isn't professionally written, and they've stopped really updating it, so there are big gaps.

But what there is is useful. It provides little test bed applications you can download and quickly play with which is sometimes all you really need.

I've been coding professionally with OpenGL (both above and below the API) for 10 years now, and the NeHe stuff still comes in useful simply as repository of information in a compact form.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

krysmopompas posted:

ARB_texture_non_power_of_two

Otherwise, round up and waste the extra space (or find a creative use for it.)
You can also use NV_texture_rectangle (which ATI supports too on the vast majority of their hardware, but reports as EXT_texture_rectangle). It's faster than non-power-of-two textures for the most part, but has its own caveats, like using pixel-based texture coordinates instead of normalized coordinates, and can't mipmap.

Non-power-of-two textures are glacially slow on a lot of hardware.

guenter
Dec 24, 2003
All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to business school!
In my game I have a "Scene" object which is right now is little more than a list of entities. It does per-frame logic like updating, rendering, and testing for collisions.

In at least two cases, my ParticleEmitter and Weapon objects, I want to be able to add entities to the scene. I'd like to just add the objects to the scene (particles, projectiles) as they're created.

I understand treating particles as full entities is probably inefficient but I'm abusing composition in my entity classes so they're already pretty lightweight and require no attention that wouldn't be needed anyways. In any case, I definitely need projectiles to have full collision and everything else other entities need.

I've thought of a few ideas for solutions which all feel dirty to varying levels.

1) Pass Scene to the ParticleEmitter and Weapon classes. This is not a dependancy I'm happy about. I'd also need to do some minor hackery to prevent objects added to the scene during update traversals from invalidating iterators and such.

2) Keep and manage my own list of entities in a list. This is a lot of duplicated code that's already found in scene in the case of Particles. In the case of Projectiles, I'm also going to need to add a lot of ugly functionality for checking for collisions between the list of projectiles and objects found in the scene.

3) Use callbacks and when I want to add a particle I raise an onCreated type event which is listened to by Scene. Meh.

4) Add a bunch of entities and to the Scene and set them dormant. Then pass those entities to the ParticleEmitter and Weapon classes on creation and they turn entities on and off. Two lists of pointers - not really dangerous with smart_ptr, but still. Lots of usually inactive junk that needs to be iterated over in Scene. Bleh.

Anyways, like I said, I don't like any of these solutions, but at least it shows I've put a little thought into it :) What's the correct way to approach this?

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
I always run into a similar problem.
If unix has taught me anything, its that your base class entity should have a getParentScene() method :)

then you can this->getParentScene()->addEntity()

Miracle Dog
Jan 22, 2005
wild

guenter posted:

1) Pass Scene to the ParticleEmitter and Weapon classes. This is not a dependancy I'm happy about. I'd also need to do some minor hackery to prevent objects added to the scene during update traversals from invalidating iterators and such.

What's wrong with this? Is it just the minor hackery or is having the sub entities dependent upon the master entity considered 'bad form' in OOP? I've always done it this way (not that I'm an expert or anything), I'd be interested to hear if there's a better alternative.

That Turkey Story
Mar 30, 2003

guenter posted:

In at least two cases, my ParticleEmitter and Weapon objects, I want to be able to add entities to the scene. I'd like to just add the objects to the scene (particles, projectiles) as they're created.

During what operation are the particles and projectiles created? Some poll operation done per update? You can always just pass a function object to that operation, and then when the ParticleEmitter or Weapon object needs to add a particle or add a projectile, it passes the necessary data to the passed-in function object. This keeps you from making the ParticleEmitters and Weapons from storing redundant data/introducing a dependency and it also allows you to separate the logic that the ParticleEmitter and the Weapon go through from exactly how the newly introduced data is added to the scene.

For instance, you mentioned there may be iterator invalidation because you'd be adding entities to your scene during an update -- if that is the case, the function object passed into your poll function could just add new entities to some temporary list that just lazily adds the new entities to the scene at the end of the entire scene update. If you later change the way your scenes and updates work, for instance, if you change it so that iterators don't get invalidated when you add new entities to the scene (i.e. by using a different container type that doesn't invalidate iterators when a new element is added, such as a list), then all you have to do is change the implementation of the function object you pass to poll while the poll operation itself remains unchanged.

A bare-bones example:

code:
class Weapon
{
/* ... */

template< typename FunctionType >
void poll( FunctionType add_entity )
{
  // Logic for when to create the projectile, modifying of the
  // weapon, etc. is still in this function here.
  if( some_condition_to_see_if_a_projectile_should_be_made )
  {
    /* Weapon related stuff goes here */

    // When the entity is to actually be added to the scene, we
    // push it off to the function object.
    add_entity( /* new projectile data goes here */ );
  }
}

/* ... */
};

guenter
Dec 24, 2003
All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to business school!
That's interesting. I could pass a functor that adds objects to the scene, like an interface, instead of giving the entire scene to Weapons and ParticleEmitters.

Crash Bandicoot
Feb 23, 2007

by T. Fine

OneEightHundred posted:

EDIT -- In MD3D they're called LockRectangle and UnlockRectangle respectively. Apparently the MSDN pages for them are broken and the only documentation for them are in Japanese, so good luck.
http://msdn.microsoft.com/en-us/library/bb152978(VS.85).aspx

I think that about sums up the problems I've been having.

I've tried various things, including using a library called SlimDX which replaced a lot of the functionality taken out, but it seems that whatever I try, Direct X does not want to play with this data as-is.

With that in mind, the only option I can see is to decompress it myself and present it in whatever format DirectX wants. Is it documented anywhere what format directX considers to be a "bitmap"?

Thug Bonnet
Sep 22, 2004

anime tits ftw

Can someone point me toward a good, no-bullshit discussion of quaternions that includes practical code examples? I always end up finding either high-level descriptions of the math involved or API-specific implementations. I'd love to see a bridge between the two somewhere. I haven't found the gamedev articles to be particularly helpful (they seem to suffer from the same problems).

more falafel please
Feb 26, 2005

forums poster

Thug Bonnet posted:

Can someone point me toward a good, no-bullshit discussion of quaternions that includes practical code examples? I always end up finding either high-level descriptions of the math involved or API-specific implementations. I'd love to see a bridge between the two somewhere. I haven't found the gamedev articles to be particularly helpful (they seem to suffer from the same problems).

The O'Reilly book Physics for Game Developers has a good explanation of quats. I haven't seen a good online discussion, but I can't say I've looked.

Thug Bonnet
Sep 22, 2004

anime tits ftw

more falafel please posted:

The O'Reilly book Physics for Game Developers has a good explanation of quats. I haven't seen a good online discussion, but I can't say I've looked.

I'll definitely check out the book. Is it good otherwise?

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Thug Bonnet posted:

Can someone point me toward a good, no-bullshit discussion of quaternions that includes practical code examples? I always end up finding either high-level descriptions of the math involved or API-specific implementations. I'd love to see a bridge between the two somewhere. I haven't found the gamedev articles to be particularly helpful (they seem to suffer from the same problems).
Quaternions can represent scale and offset transformations too, but they're usually used for rotations so I'll stick to that:

As far as the basic concept, which I found makes them a lot easier to digest: Any rotational transformation can be represented as a rotation around an axis in space. Quaternions are exactly that. The advantage is that they are valid as several other types of values as well (i.e. as sphere coordinates and complex numbers) so there are a lot of valid ways to manipulate them.

The X, Y, and Z components are the rotation axis multiplied by the sine of the rotation angle, the W component is the cosine of the rotation angle.

Getting the opposite transformation can be done by negating the X, Y, and Z components (which reverses the rotation direction), or by negating the W component (which flips the rotation axis). For why it does those, see the previous paragraph, and remember that negating a sine result is the same as negating the angle, and negating a cosine result is the same as a 180-degree offset of the angle.

Since these operations cancel each other out, negating all 4 components will actually result in the same transformation, which is useful if you're trying to manipulate the sign of the W component.

As a sphere coordinate (X^2 + Y^2 + Z^2 + W^2 = 1), it's easy to fix error accumulation by just renormalizing them, they're easy to store compactly because you can recalculate its W component (and force the sign), and you can interpolate them smoothly with spherical lerp.

As a complex number, multiplying two quaternions produces the same result as combining their rotations the same way as a matrix concatenation would.


If you need some code, you can rip off mine:
http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_rotation.hpp?view=log
http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_math_quat.hpp?view=log
http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_math_quat.cpp?view=log
http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_math_matrix.cpp?view=log (Has the matrix-to-quaternion code)


If you want some no-bullshit explanation of the math involved and formulae:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm

OneEightHundred fucked around with this message at 10:19 on Jun 13, 2008

tyrelhill
Jul 30, 2006
I usually start here:
http://www.j3d.org/matrix_faq/matrfaq_latest.html

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
How is animation handled in 3D with XNA? Is there a good tutorial perhaps?

vanjalolz fucked around with this message at 16:16 on Jun 15, 2008

Intel Penguin
Sep 14, 2007
hooray

vanjalolz posted:

How is animation handled in 3D with XNA? Is there a good tutorial perhaps?

I know they have custom content processors to import animations. I'd just go download it and have a look through the documentation. It's quite extensive and practical stuff.

OK here's something I'm curious about : I'm making a top down shooter. I've created my own archive format to store game info. I'm leaving all the art assets up to XNA, but I figured I'd build my own format to store all my animation and tileset data. The main reason for doing this was so that I could encrypt the data.

I wrote a class library and it works like a charm. I can pack lots and lots of files easily, and get a MemoryStream of a file in the archive. You basically enter a password for each operation and if the password is wrong, the method just fails.

Now my question is, what's the best way to store the key to the archive? The simple answer is to use the same key for all the archives and store it as a constant in the game, but I can't imagine that'd be very secure.

Oh yeah, right now I'm using a symetrical key system.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Intel Penguin posted:

Now my question is, what's the best way to store the key to the archive? The simple answer is to use the same key for all the archives and store it as a constant in the game, but I can't imagine that'd be very secure.

No method will, in practice, be any better than this. The DRM problem is incredibly hard to solve.

What are you trying to prevent through your use of encryption? It sounds like you may be using the wrong tool for the job.

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
Sounds like you're trying to stop people from editing the files to get an unfair advantage in game. I think you'd need to use some kind of CRC method for this, but ultimately you just need to put in more effort protecting your game than the hackers are willing to put in to break it.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

vanjalolz posted:

Sounds like you're trying to stop people from editing the files to get an unfair advantage in game. I think you'd need to use some kind of CRC method for this, but ultimately you just need to put in more effort protecting your game than the hackers are willing to put in to break it.

They could just edit the CRC to match the modified data.

If he's trying to prevent editing by cheaters, then he wants to use a signature and a public key. If he's trying to protect his art assets from copying, then embedded watermarks might be the best plan. If he's trying to protect his game from wholesale piracy, then I have some bad news...

Intel Penguin
Sep 14, 2007
hooray

ShoulderDaemon posted:

They could just edit the CRC to match the modified data.

If he's trying to prevent editing by cheaters, then he wants to use a signature and a public key. If he's trying to protect his art assets from copying, then embedded watermarks might be the best plan. If he's trying to protect his game from wholesale piracy, then I have some bad news...

It's the prevention of tempering I'm looking to prevent. Though I doubt anyone will have the motivation to crack my game.

My project is so hobbyist. I don't plan on selling it, and chances are it won't go beyond my circle of friends. I was just curious.

Null Pointer
May 20, 2004

Oh no!
If it were for multiplayer cheat-prevention, I'd base the it on a hash of a host-dictated concatenation of random segments of loaded assets. Someone who could bypass that would probably write a trainer before bothering with content editing.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Null Pointer posted:

If it were for multiplayer cheat-prevention, I'd base the it on a hash of a host-dictated concatenation of random segments of loaded assets. Someone who could bypass that would probably write a trainer before bothering with content editing.

Yeah, for multiplayer this means that the cheater needs to at least alter the program code or directly manipulate the network stream (and keep a copy of the unaltered files, but that's obviously easy).

For single player, you probably want to just sign the data files, and store the public key in the program executeable. You could also hash the data files and store the hashes, but that means that every time you change the data, you have to recalculate the hash, alter the code, and rerelease the program. Either way, the cheater has to change the program executeable itself (which is far from difficult, but at least isn't trivial).

If you have more time to put into this, then augment your data model: Wherever you would normally just have a constant in the data, add the possibility to use the CRC of a segment of a data file, XORed with a constant (with the other data file, the start and end of the segment, and the XOR constant specified inline). Then just pepper your data files with spaghetti references to eachother. A cheater could still attack the data files, but they'd have to write a helper program to undo the cross-references first, or risk random in-game corruption.

To make it even more devious, incorporate the same references into your program code, at critical points of the program.

Jo
Jan 24, 2005

:allears:
Soiled Meat

ShoulderDaemon posted:

A cheater could still attack the data files, but they'd have to write a helper program to undo the cross-references first, or risk random in-game corruption.

Also, he should pepper the assets directory with goatse pictures in random formats and sizes to keep people from digging around in the content folder.

newsomnuke
Feb 25, 2007

Related, there's a fascinating article on crack-protection at Gamasutra.

heeen
May 14, 2005

CAT NEVER STOPS
I want to convert eye-coordinates into world-coordinates in my geometry shader, but soemthing is a bit off here:
code:
vec4 ws_points[3];
	for(int i=0; i<3; i++) //original triangle
	{
		ws_points[i]=gl_ModelViewMatrix*camtrafoinv*gl_PositionIn[i];
		//do something in worldspace
		gl_ClipVertex=camtrafo*ws_points[i];
		gl_Position=gl_ProjectionMatrix*camtrafo*ws_points[i];
		gl_FrontColor=vec4(1,0,0,1);
		EmitVertex();
		
	}
	EndPrimitive();
vertices that are already in worldspace work fine, but vertices with an additional transform get rotated strangely.
edit: nevermind, got it.

heeen fucked around with this message at 18:30 on Jun 17, 2008

FigBug
Apr 27, 2002

Lemon Party - Lest we Forget
I'm working on product that has a haptic knob on it, and I want to add an easter egg, so I'm thinking of break out. It seems simple enough, since I don't have much time to work on it. The only thing I don't know is the rule for the ball bouncing off of the paddle. I know the angle varies by the position the ball strikes the paddle, but does anybody know exactly how?

Or, what are some other simple knob based games I could implement that could make use of force feedback? For breakout, I'm just making the user feel a bump as the paddle hits the wall.

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

FigBug posted:

I'm working on product that has a haptic knob on it, and I want to add an easter egg, so I'm thinking of break out. It seems simple enough, since I don't have much time to work on it. The only thing I don't know is the rule for the ball bouncing off of the paddle. I know the angle varies by the position the ball strikes the paddle, but does anybody know exactly how?

Or, what are some other simple knob based games I could implement that could make use of force feedback? For breakout, I'm just making the user feel a bump as the paddle hits the wall.

There's always the original dial game, "Pong"

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha

FigBug posted:

breakout

If you know how to work out the default angle, then you can just fudge it depending on how far away [the ball and paddle collision point is from the center of the paddle].

vanjalolz fucked around with this message at 03:25 on Jun 20, 2008

Glomper Squeeman
Jun 11, 2006

The cat does not see the cliff.

FigBug posted:

I'm working on product that has a haptic knob on it, and I want to add an easter egg, so I'm thinking of break out. It seems simple enough, since I don't have much time to work on it. The only thing I don't know is the rule for the ball bouncing off of the paddle. I know the angle varies by the position the ball strikes the paddle, but does anybody know exactly how?

Or, what are some other simple knob based games I could implement that could make use of force feedback? For breakout, I'm just making the user feel a bump as the paddle hits the wall.

You might want to try something where you add the distance from the center of the paddle to the ball to the ball's x speed, then do something like (assuming you're using some sort of vector for the ball's speed) normalize the ball's speed, and multiply it by the speed you want. I haven't tried this, so I have no idea how it works in practice.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Intel Penguin posted:

It's the prevention of tempering I'm looking to prevent. Though I doubt anyone will have the motivation to crack my game.

My project is so hobbyist. I don't plan on selling it, and chances are it won't go beyond my circle of friends. I was just curious.
If it's not going to be extremely popular, then you don't really need to do much in the way of hack protection. If it is, then you're probably hosed no matter what you do, and would want to outsource it to someone like Even Balance that can at least pretend to focus on the intricacies of cheat-proofing full-time.

Delayed-response poisoning strikes me as one of the best solutions because it makes the trial-and-error process much more time-consuming: In single-player games, remove something critical that makes the game unbeatable. In multi-player games, delay bans for a long time after the cheats are detected. In either, act buggy.

Personally, for multiplayer games, I really think the solution is to make a better player moderation system. I've seen too many games where, for example, kick votes invariably fail to go through because they require a majority vote and the people who aren't getting griefed or steamrolled by a cheater can't be bothered to vote. There has to be a better way.

OneEightHundred fucked around with this message at 11:12 on Jun 21, 2008

Intel Penguin
Sep 14, 2007
hooray

OneEightHundred posted:

Personally, for multiplayer games, I really think the solution is to make a better player moderation system. I've seen too many games where, for example, kick votes invariably fail to go through because they require a majority vote and the people who aren't getting griefed or steamrolled by a cheater can't be bothered to vote. There has to be a better way.

maybe everyone HAS to vote, but you can choose to abstain in which case your vote is taken out of the equation. or let the players report others and keep logs of the games for proof.... ugh. it's almost not worth it.

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
Only games I've seen require you to enter a menu and add a vote to kick. When X number of votes are reached, it kicks. Its not a yes/no vote, its a vote to kick.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
I'm not saying that there needs to be a better way to do a kick vote, if anything I think kick votes have repeatedly proven their uselessness. Compulsory voting would be far too easily abusable for griefing.

There are other forms of player moderation, like karma-type systems, but the only one that doesn't suck horribly is "have a shitload of admins." I'm trying to come up with a better way of letting the players clear the shitheads off servers, because if something like that exists, problematic cheaters would not get far, and it would have benefits in getting rid of other problems as well, i.e. griefers.

OneEightHundred fucked around with this message at 22:15 on Jun 22, 2008

Intel Penguin
Sep 14, 2007
hooray
Oh yeah, I also want to encrypt the save games. I know people will probably be able to crack it fairly easily, but I think any encryption is better than exposing the savegames as plaintext.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
Plaintext saves aren't a great idea for numerous reasons, especially if you're using floating point numbers which lose information when converting to/from ASCII. Regardless, hacking savegames is probably the last thing you should worry about. It's more likely someone will just write a trainer, in which case anything you do to the savegame data is kind of moot.

I really have to ask: What do you expect to get out of all this security? Is the title you're releasing even big enough for people to waste their time hacking it?

TSDK
Nov 24, 2003

I got a wooden uploading this one
If you just want a quick and dirty method to stop people messing with the file, then hard-code a salt value into the exe and append the MD5 of the save file contents + salt to the end of the save file.

It's not going to stop anyone with enough nouse to go through your exe to find the salt value and write a tiny tool to 'sign' modified save files, but then you were never going to stop someone with the skills to do that anyway.

Intel Penguin
Sep 14, 2007
hooray

OneEightHundred posted:

Plaintext saves aren't a great idea for numerous reasons, especially if you're using floating point numbers which lose information when converting to/from ASCII. Regardless, hacking savegames is probably the last thing you should worry about. It's more likely someone will just write a trainer, in which case anything you do to the savegame data is kind of moot.

I really have to ask: What do you expect to get out of all this security? Is the title you're releasing even big enough for people to waste their time hacking it?

My need for it isn't proportionate to the number of replies I've gotten. I was just curious, really. and no, it's not really worth too much security. I just wanted a "quick and dirty" method like the one just posted above.

Although the idea of someone actually writing a trainer for my game is kind of cool.

Murodese
Mar 6, 2007

Think you've got what it takes?
We're looking for fine Men & Women to help Protect the Australian Way of Life.

Become part of the Legend. Defence Jobs.
Another semester, another delightful project unit - this time we're allowed to use C++ though :v

Same trouble as before (many pages ago), Quaternion twist. ie. When in free-look mode with the camera (space-sim style), a rotation of left-down-right-up or any similar combo will end up with a slight twist around the z axis.

Code is here: http://chimtest.game-host.org/CameraExample.rar

Please ignore the lovely glbase code, I'm just using it to drop in the class and test it.

Function that probably causes it:
Camera::glCamera() (Camera/Camera.cpp)

You're also welcome to mock my unfinished code and suggest improvements / berate me for doing stupid things.

e; logic in my brain suggests that this is intentional quaternion rotation (which I can explain properly with my hands but not on paper)

ee; vanja is gay

Murodese fucked around with this message at 15:48 on Jun 25, 2008

Jo
Jan 24, 2005

:allears:
Soiled Meat
I've got a message rendering function and a strange problem associated with it:

code:
/** DialogManager::renderText
 * @args message The message to be printed.
 * @args x The X based on the number of tiles from the left.
 * @args y The Y based on the number of tiles from the bottom.
 */
void renderText( char * message, float x, float y )
{
	int messageLength = strlen( message );
	glLoadIdentity();
//	glBindTexture( GL_TEXTURE_2D, font ); // When I uncomment this line, the screen goes black or doesn't draw.
	glTranslatef( x, y, 0 );

	for( int a=0; a < messageLength; a++ )
	{
		if( message[a] == '\n' )
		{
			glTranslatef( -1*a*FONT_SIZE, -1*FONT_SIZE, 0 );
			continue;
		}

		glTranslatef( FONT_SIZE, 0, 0 );
		glBegin( GL_QUADS );
			glTexCoord2f( message[a]*characterScale, 0 );//glTexCoord2f( (message[a]%16)/16, (message[a]/16)/16 ); // 0, 0 lower left
			glVertex2f( 0, 0 ); // Tiles are 32x32 and take up 1.  Font is 16x16 and takes up 0.5
			glTexCoord2f( message[a]*characterScale, 1 );//glTexCoord2f( (message[a]%16)/16, (1+(message[a]/16))/16 );
			glVertex2f( 0, FONT_SIZE );
			glTexCoord2f( (1+message[a])*characterScale, 1 );//glTexCoord2f( (1+(message[a]%16))/16, (1+(message[a]/16))/16 );
			glVertex2f( FONT_SIZE, FONT_SIZE );
			glTexCoord2f( (1+message[a])*characterScale, 0 );//glTexCoord2f( (1+(message[a]%16))/16, ((message[a])/16)/16 );
			glVertex2f( FONT_SIZE, 0.0 );
		glEnd();
	}
}
I'm not sure why that one line would make so much of a difference. I've tried changing textures to no avail.

Jo fucked around with this message at 04:26 on Jun 29, 2008

Adbot
ADBOT LOVES YOU

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha

Jo posted:

I'm not sure why that one line would make so much of a difference. I've tried changing textures to no avail.
Your fonts don't render or nothing at all renders?
Double check that your font texture is loaded properly, and make sure you're rebinding the old texture once you're done (with the font drawing stuff).

eee; Muro your code is bad, consider yourself berated. Quaternion sounds so much like quantum physics.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply