This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composite_files=`cat p3dtoolbase_composite1.cxx | cut -d '"' -f 2` | |
$ time g++ -c $composite_files -I../../../build/dtool/ -I/usr/include/python2.7 | |
real 0m4.643s | |
user 0m4.151s | |
sys 0m0.477s | |
$ time g++ -c p3dtoolbase_composite1.cxx -I../../../build/dtool/ -I/usr/include/python2.7 | |
real 0m0.848s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Released by rdb under the Unlicense (unlicense.org) | |
# Based on information from: | |
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt | |
import os, struct, array | |
from fcntl import ioctl | |
# Iterate over the joystick devices. | |
print('Available devices:') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Released by rdb under the Unlicense (unlicense.org) | |
# Further reading about the WinMM Joystick API: | |
# http://msdn.microsoft.com/en-us/library/windows/desktop/dd757116(v=vs.85).aspx | |
from math import floor, ceil | |
import time | |
import ctypes | |
import _winreg as winreg | |
from ctypes.wintypes import WORD, UINT, DWORD | |
from ctypes.wintypes import WCHAR as TCHAR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple render to texture | |
node = loader.loadModel("panda") | |
depthtex = Texture('depth') | |
depthtex.set_clear(1.0) | |
colortex = Texture('color') | |
colortex.set_clear((0, 0, 0, 1)) | |
normaltex = Texture('normal') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Light: | |
def __init__(self): | |
self.pos = ParamVector3f(0) | |
self.color = ParamVector3f(1,1,0) | |
self.mvp = ParamMatrix4f(0) | |
self.struct = StructParameter() | |
array = ArrayParameter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Known pipe types: | |
wglGraphicsPipe | |
(all display modules loaded.) | |
:audio(debug): create_AudioManager() | |
audio_library_name="p3openal_audio" | |
:audio(debug): dl_name="libp3openal_audio.so" | |
:audio(debug): symbol of get_audio_manager_func_openal_audio = 000007FEECD026F0 | |
:audio(debug): Create_OpenALAudioManager() | |
AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005 | |
:audio(error): OpenALAudioManager: alcOpenDevice(NULL): ALC couldn't open device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/videodev2.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
struct v4l2_fmtdesc fmt; | |
int i; | |
const char *dev; | |
int fd; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from panda3d.core import Shader | |
vshader = """#version 140 | |
// Vertex inputs | |
in vec4 p3d_Vertex; | |
in vec2 p3d_MultiTexCoord0; | |
// Uniform inputs | |
uniform mat4 p3d_ModelViewProjectionMatrix; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
import os | |
glsl_extensions = {'v': '.vert', 'f': '.frag', 'g': '.geom'} | |
if len(sys.argv) != 2: | |
print("Usage: cg2glsl.py something.sha") | |
sys.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clang -O3 gl-preferred-format.c -o gl-preferred-format -lGL -lglut | |
#include <stdio.h> | |
#define GL_GLEXT_PROTOTYPES | |
#if defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__)) | |
#include <GLUT/glut.h> | |
#else | |
#include <GL/glut.h> |
OlderNewer