mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-20 16:35:47 +08:00
Update code to v1.0.14 (10)
This commit is contained in:
27
android/extern/libvncserver/examples/server/simple15.c
vendored
Normal file
27
android/extern/libvncserver/examples/server/simple15.c
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/* This example shows how to use 15-bit (which is handled as 16-bit
|
||||
internally). */
|
||||
|
||||
#include <rfb/rfb.h>
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
int i,j;
|
||||
uint16_t* f;
|
||||
|
||||
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,5,3,2);
|
||||
if(!server)
|
||||
return 1;
|
||||
server->frameBuffer=(char*)malloc(400*300*2);
|
||||
if(!server->frameBuffer)
|
||||
return 1;
|
||||
f=(uint16_t*)server->frameBuffer;
|
||||
for(j=0;j<300;j++)
|
||||
for(i=0;i<400;i++)
|
||||
f[j*400+i]=/* red */ ((j*32/300) << 10) |
|
||||
/* green */ (((j+400-i)*32/700) << 5) |
|
||||
/* blue */ (i*32/400);
|
||||
|
||||
rfbInitServer(server);
|
||||
rfbRunEventLoop(server,-1,FALSE);
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user