The title should be self explanatory. Does the method getTextureData() from the Texture class return the byte array that is stored within an OpenGL texture, or is it just a copy? I'm alright if either are the case, but I just want to know. If you're curious, I'm using it for my Button class. The class ignores mouse clicks and rollovers if a pixel has an alpha of 0.

I'm pretty sure that that's a copy, since OpenGL usually stores their textures on the Graphics Card's memory, so to use it in your code, it needs to be sent to your RAM.

I wouldn't implement that for your Button class You should simply expect your button to be able to be clicked in the corners, even if they are rounded off.

Also, the copying means a lot of performance decrease in your application, but only if you do that every frame (which I don't expect ^^).

In my opinion: Just don't

I could imagine that the copy would create a memory overhead. Overall performance, though, shouldn't take much of a hit. All I do is specify an index in the 1-dimensional byte array (treating it as a matrix, of course) based on the mouse's X and Y coordinates, and check to see if it is zero or not. Nothing too fancy. It actually hasn't put a hit on my performance. I also have a method that can turn on and off this feature. By default, it is turned off, meaning that the only memory overhead in the event that this feature is not implemented is a null pointer.

Edit: I misinterpreted what you said. Of course I'm not copying it every frame. My bad.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org