-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScreen.java
32 lines (31 loc) · 861 Bytes
/
Screen.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Plot;
/**
*
* @author Administrator
*/
public class Screen {
private static int width, height;
public static int[] pixels;
public Screen (int width, int height){
this.width=width;
this.height=height;
pixels= new int[width*height];
}
public static void render(){
for(int y=0; y < height; y++){
for(int x=0; x < width; x++){
pixels[x+y*width]=0xFFFFFF;// make every pixel white;
}
}
}
public static void clear(){
for(int i=0; i < pixels.length;i++){
pixels[i]=0;// make every pixel black
}
}
}