Stub now using render clear

master
mantis 2023-09-11 16:34:49 +02:00
parent ec84a8c5d7
commit d30d182d3e
1 changed files with 7 additions and 4 deletions

View File

@ -68,18 +68,21 @@ def prepare_render_buffer(r,g,b):
render_buffer.append(g)
render_buffer.append(b)
def clear_render_buffeR(r,g,b):
def clear_render_buffer(r,g,b):
global render_buffer
for y in range(DISPLAY_RES_Y):
for x in range(DISPLAY_RES_X):
render_buffer[2+x+y*x]=r
render_buffer[3+x+y*x]=g
render_buffer[4+x+y*x]=b
x3 = x*3
res3 = DISPLAY_RES_X*3
render_buffer[2+x3+y*res3]=0
render_buffer[3+x3+y*res3]=0
render_buffer[4+x3+y*res3]=255
def render_stub():
global render_buffer
prepare_render_buffer(255,0,0)
clear_render_buffer(0,0,255)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(render_buffer, (FLASZKI_UDP_IP, FLASZKI_UDP_PORT))
time.sleep(3)