Menu Home

x11

开机自动启动x11vnc脚本

#!/bin/sh while true do AUTH_ID=`ps -ef | grep auth | grep -v grep |grep -v xinitrc | awk ‘{print $13}’` if [ “$AUTH_ID” = “” ];then echo “waiting for ready, retry 10s later…” else x11vnc -auth $AUTH_ID -display :0 -xdamage -ncache_cr fi sleep 10 done os: opensuse 11.4

xlib创建一个openGL简单窗口

void CreateWindow(int width, int height) { XInitThreads(); m_scrWidth = width; m_scrHeight = height; int attr[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DOUBLEBUFFER, True, GLX_DEPTH_SIZE, 16, None, }; m_dpy = XOpenDisplay(NULL); if (m_dpy == NULL) { cerr << “XOpenDisplay error” << endl; return; } int nelements; GLXFBConfig *fc = glXChooseFBConfig(m_dpy, 0, attr, &nelements); […]