Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Jogl textures suddenly gone on: 2013-03-13 03:38:14
Hahaha wooow. Whelp this was a case of severe over-thinking haha. I did end up optimizing my rendering pipeline as a result though, which isn't a bad thing. Turns out that all that happend was when I modified my first loaded png and replaced it, I somehow saved it at non power of 2 size. All's fine now. Back to pounding out code and sorry for wasting forum space haha  Clueless
2  Game Development / Newbie & Debugging Questions / Re: Jogl textures suddenly gone on: 2013-03-06 08:18:03
Sorry, I should have been a bit more specific. The maps I am using are hashmaps and I can't load EVERY texture at the beginning because there are a massive amount of textures. I'm having the textures loaded based on needs of the zone that the player is in at that moment.

Update: I just tried rewriting the program with a new class called texture pack that has a String Name field and TextureData Data field and created an arraylist with this object (just in case the object[] arraylist concept was what was causing the problem.) Results are still the same, so I'm thinking something may be bad with the input stream...  Clueless  Again, it'd be great if I could find a way to look at the actual pixel array of the texture to see if there is anything there.... Huh

I'll keep updating. Thanks for the feedback HeroesGraveDev
3  Game Development / Newbie & Debugging Questions / Jogl textures suddenly gone[solved] on: 2013-03-06 05:06:03
Hi all, I'd like to start off by saying I love this site and that this is my first actual post.  Grin

Alright, so here's the story...

I had a program which created objects and put them in a main list (arraylist). These objects would load an image into a texture data buffer map (map so that they had a string identifier) and when the renderer class display method was called from the fpsanimator it would iterate over the buffer map, using the textureIO.newtexture method (because the context is now current), load it into a loadedtexture map, enable the texture, call the display method of each object in the main list, and then clear the buffer. These display methods would bind the needed textures from the loadedtexture map in my renderer class and execute the drawing functions.

This program would normally render correctly. Though I started obviously having simultaneous modification errors on my buffer map because of my main thread adding textures at the same time the animator thread is causing the renderer display thread to iterate over the buffer.

Instead of creating a synchronized modification method for the map I decided to instead make it an arraylist where the main thread could write textures to the end of the list while the animator thread could peal off the first object in the list to use textureIO so that there were no longer thread collisions. To do this I had to make it an arraylist of object[2] with the 0 value being the string identifier and the 1 value being the texture.

Now the textures aren't showing up. After a bit of ghetto debugging I know that the string identifiers in the loadedtexturemap are correct and that the texture data of each key/value pair at least has the correct img height/width showing that they at least aren't null or duplicated. I'm not sure how to println straight pixel array data of textures to make sure that the textures actually have data that should be rendering (btw the textures are RGBA png)

I guess my question is, how (in debugging) can I determine if the texture that I am using has valid data?

Also the only reason I haven't uploaded the code yet is because it seems like a lot to upload here and I'm a bad bad programmer for not putting good comments to make the code readable. I'll upload at least the applicable methods once I get my comments in there  Undecided
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (31 views)
2014-04-15 18:08:23

BurntPizza (28 views)
2014-04-15 03:46:01

UprightPath (43 views)
2014-04-14 17:39:50

UprightPath (25 views)
2014-04-14 17:35:47

Porlus (42 views)
2014-04-14 15:48:38

tom_mai78101 (64 views)
2014-04-10 04:04:31

BurntPizza (124 views)
2014-04-08 23:06:04

tom_mai78101 (223 views)
2014-04-05 13:34:39

trollwarrior1 (190 views)
2014-04-04 12:06:45

CJLetsGame (198 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!