Finally!

Aug. 23rd, 2009 06:51 pm
carlfoxmarten: (Default)
[personal profile] carlfoxmarten
Textures work now! Woohoo!

Man, I really do prefer Java to C++, but since I've been using C++ more recently, I'm having to relearn things I took for granted with Java.

For instance, in Java, everything is not referenced directly, so when you create an object, you pass around a pointer to the object instead of passing around the object itself. However, in C++, you pass around copies of the object itself instead of pointers (unless you choose to work with the pointers, that is).

I'd created a class to help with textures by providing a simple interface for applying and disabling textures.
One of its features was a "destructor" that would tell OpenGL to drop the enclosed texture when any copy of the object was destroyed. Simply passing the texture to a sub-function or method would make a second copy that would destroy the texture when that method was finished...

Fortunately, if I don't delete the textures myself, it seems to delete them when my program is finished anyway, so removing the delete code has fixed the most elusive problem.

Now that textures are working, I can use them now to full potential, and my rounded-border stuff is working okay.
(it doesn't quite look right yet)
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

carlfoxmarten: (Default)
Carl Foxmarten

August 2023

S M T W T F S
  12 345
6789101112
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 9th, 2025 01:48 pm
Powered by Dreamwidth Studios