Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    216028

Untitled

Sign in to follow this  
Mushu

82 views

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  


6 Comments


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
Quote:
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