Implement AWT in JOGL
Posted by choracy69 on Feb 16, 2016; 10:47pm
URL: https://forum.jogamp.org/Implement-AWT-in-JOGL-tp4036268.html
But I have question, because I have some code in AWT and I want implement in JOGL. Code in AWT in INIT():
mwfuel = new Color(190,204,91).getRGB();
tranfuel = new Color(168,192,20).getRGB();
conifuel = new Color(85,101,39).getRGB();
decifuel = new Color(110,80,42).getRGB();
burnt = new Color(48,48,48).getRGB();
bfire = new Color(192,64,0).getRGB();
fire = new Color(255,96,0).getRGB();
grid = new int[d][h];
futureGrid = new int[d][h];
for (int i=0; i<d;i++){ // sets the whole terrain to 0 indicating that this pixel did not catch fire
for (int j=0; j<h;j++){
grid[i][j] = 0;
terrain = rand.nextInt(5);
switch(terrain) {
case 1:
bi.setRGB(i,j,mwfuel);
break;
case 2:
bi.setRGB(i,j,tranfuel);
break;
case 3:
bi.setRGB(i,j,conifuel);
break;
case 4:
bi.setRGB(i,j,decifuel);
break;
}
}
}
How can I use something like that in JOGL:
new Color(168,192,20).getRGB();
And something like:
bi.setRGB(i,j,conifuel);
Where bi is: BufferedImage bi;
Thanks for any reponse.