![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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)
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)