These pages are written by only Japanese.

Welcom to My Diary.com
最新の日記タイトル一覧カテゴリ別タイトル一覧トップへ戻る〜

こんばんわ♪ 現在は5月18日(土)18時16分。 今日も残業なのでしょうか?


hns - 日記自動生成システム - Version 2.19.5 (色々 Fixed)

先月 2010年07月 来月
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
Namazu for hns による簡易全文検索です。
詳細は 詳細指定/ヘルプをご参照下さい。
検索式:

2010年07月29日(木)

PHP で OpenGL/GLUT

sotarok 先生 に phpopengl なる物を教わったので、試してみたらあっさり動いた。 結果 →
PHP4 用だったのと OpenGL の定数マクロが少し異なるので、少し改造した。 以下、CentOS4 + PHP5 上で build した作業内容詳細。

build 開始:

% mkdir phpopengl
% cd phpopengl
% cvs -d:pserver:anonymous@phpopengl.cvs.sourceforge.net:/cvsroot/phpopengl login
% cvs -z3 -d:pserver:anonymous@phpopengl.cvs.sourceforge.net:/cvsroot/phpopengl co -P .
% cd php_opengl
% (cd opengl ; phpize ; ./configure ; make ) # ☆ これで失敗する ☆
% (cd gult   ; phpize ; ./configure ; make )

_EXT:

gult はあっさり build 成功。
opengl はコンパイル時に error が出力された。
/home/yoya/cvs/phpopengl/php_opengl/opengl/php_opengl.c:5779: error: 'GL_COLOR_TABLE_GREEN_SIZE_EXT' undeclared (first use in this function)
どうやら、これらの ..._EXT は ..._SGI と同じ値っぽい。 #define ..._EXT ..._SGI を片っ端からかけて解決。

BYREF_:

/home/yoya/cvs/phpopengl/php_opengl/opengl/php_opengl.c:56: error: 'BYREF_FORCE' undeclared here (not in a function)
/home/yoya/cvs/phpopengl/php_opengl/opengl/php_opengl.c:59: error: 'BYREF_NONE' undeclared here (not in a function)
BYREF_... は PHP4 extension の引数定義に使うもので、 PHP5 では ZEND_BEGIN_ARG_INFO を使うらしい。
% grep BYREF_ ~/src/php/php-4.0.0/*/*.h
/home/yoya/src/php/php-4.0.0/Zend/zend.h:#define BYREF_NONE 0
/home/yoya/src/php/php-4.0.0/Zend/zend.h:#define BYREF_FORCE 1
/home/yoya/src/php/php-4.0.0/Zend/zend.h:#define BYREF_ALLOW 2
/home/yoya/src/php/php-4.0.0/Zend/zend.h:#define BYREF_FORCE_REST 3
とりあえず、全部 NULL に define する。
(リフレクションに問題あるらしいけど、そんなの後あと)
/* {{{ arginfo */
#ifdef ZEND_ENGINE_2
#define force_ref_first_arg  NULL
#define force_ref_second_arg NULL
#define force_ref_third_arg  NULL
#define force_ref_fourth_arg NULL
#define force_ref_ninth_arg  NULL
#else
(BYREF_ 何とかしてる場所)
#endif
/* }}} */

github:

折角なので、github に登録してみた。
  • 公開鍵を登録 (テキストをWebの登録画面に張り付けるだけ)
  • 手元に repository を作成
  • 手元の master に commit
  • github 上の origin に push
オリジナルのソースを登録
% mkdir phpopengl
% cd phpopengl
% git init
(オリジナルの php_opengl samples をコピーしてくる)
% git add php_opengl samples
% git commit -m 'copy from phpopengl.cvs.sourceforge.net:/cvsroot/phpopengl'
% git remote add origin git@github.com:yoya/phpopengl.git
% git push origin master
改造分を反映(commit & push)
% emacs php_opengl.h
(編集)
% emacs php_opengl.c
(編集)
% git commit -a
(vi 画面が開くので上の方にコメントを追記)
% git push origin master

大問題:

phpopengl でなく swfed の問題を見つけてしまった。。。
  • はじめ、サンプルプログラムが動かなかった
  • 何故か、output が redefined されてるって怒られる
  • あれ、SWF Editor を外すと動く。。。
  • ちょw SWF Editor のクラスメソッドが global function で見えてるぅぅぅ。
  • ごめんなさい何とかします。

これで、1 日分だよ〜。

タイトル一覧
カテゴリ分類
Database
JXTA
Java
XML
awm
bookmark
keyword
memo
news
research
Powered by hns-2.19.5, HyperNikkiSystem Project