Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


Fuck, I'm not even going to describe what I went through to try to get this shit to work. I isolated the vertex buffer class. Compared it to my older, working code. Saw no differences, AT ALL, except that the "new" one is somehow corruping the stack, or something (the this pointer changes mid-function, and somehow manages to NULL itself, and other fucked up shit).

Don't expect to see me for a couple days. I'm gone.
Sign in to follow this  


Recommended Comments

bring on the dancing girls!

On topic, I'd suggest as a debugging method slowly chopping more and more things out of your code, while keeping it functional. Note the point at which it starts working - that's where your problem is. It doesn't always work, because sometimes you can't boil it down any simpler while keeping it working, but it's worth a try.

Share this comment

Link to comment
Original post by baldurk
On topic, I'd suggest as a debugging method slowly chopping more and more things out of your code, while keeping it functional.

Of course. The vertex buffer code was isolated into a separate project for rigorous debugging - and failed mysteriously and miserably. And it consisted of about 12 gl calls.

Debugging showed that the problem was from the this pointer becoming NULL arbitrarily halfway through some of the member functions after a call to glSetClientState (or something), which suggests something is really fucked up.

So I decided I'm going to scrap it and get around to doing some of the stuff I said I was going to do -

- Virtual File System.
- Rewrite Graphics Adapters
- D3D!!! (and OpenGL backups for portability? HA!)
- MUI v2.0 (GUI library rewrite)

This codebase rewrite will give me a much better base to build a game upon. Overall, the worst thing I was going through with the previous project was the frustration of poorly written basecode.

Fixing it at the root of the problem.

Share this comment

Link to comment
Look at your last entry, I think I saw a mistake in the stuff you post. (Don't get your hopes up, it's been a while since I touched gl).

Share this comment

Link to comment
Yeah, the way I was doing it with stride-sex is entirely valid (and in fact, taken directly from the Red Book). glInterleavedArrays is basically the shortcut way of doing things - on a low level it basically does the same thing. The problem with glInterleavedArrays (and the reason I don't much like it) is because you have to lay out your datastructures exactly perfectly since it directly calculates offsets. There's a nice trick you can do my way so that you can add/remove stuff from the vertex class without having to worry about the member offsets at all (not shown in previous code).

Thanks for the help though :)

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!