写真 青い空と雲と建物と木々の緑

nishimotzの日記

  • Ubuntu Linux 8.10 + freeglut3 + FreeType2

    GLUT で日本語を表示するのは面倒だと思っていましたが、意外に簡単でした。
    とはいえ、例によって単純なコピーペーストでは成功しなかったので、メモしておきます。

    // main.cpp
    // encoding : UTF-8
    //
    // sudo apt-get install libftgl-dev freeglut3-dev
    // g++ -g -I/usr/include/freetype2 -lglut -lftgl main.cpp
    //
    #include <GL/glut.h>
    #include <FTGL/ftgl.h>
    #define FONT "/usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf"
    FTFont *font;
    void display(void)
    {
    glClearColor(0.0, 0.0, 1.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(1.0, 1.0, 1.0, 1.0);
    FTPoint point(-1, 0, 0);
    font->Render("日本", -1, point);
    glFlush();
    }
    int main(int argc, char *argv[])
    {
    font = new FTGLPolygonFont(FONT);
    if (font->Error()) exit(1);
    font->FaceSize(0);
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGBA);
    glutCreateWindow(argv[0]);
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
    }
  • Ubuntu Linux 8.10 + Lenovo ThinkPad X300

    トラックポイントを青ボタンと同時に押したときにスクロールする設定。

    $ sudo gedit /etc/X11/xorg.conf
    Section "ServerFlags"
    Option "AutoAddDevices" "false"
    EndSection
    Section "InputDevice"
    Identifier	"Configured Mouse"
    Driver		"mouse"
    Option		"CorePointer"
    Option    	"Emulate3Buttons"     	"false"
    Option          "EmulateWheel" 		"true"
    Option          "EmulateWheelTimeOut" 	"200"
    Option          "EmulateWheelButton" 	"2"
    Option          "XAxisMapping"        	"6 7"
    Option          "YAxisMapping"        	"4 5"
    Option          "ZAxisMapping"        	"4 5"
    EndSection
    

    参考リンク:

  • Windows Eclipse CVS sourceforge.jp

    Windows XP で Eclipse 3.4.1 の CVS クライアントを使って sourceforge.jp のアカウントで作業を。。

    anonymous ではなく sourceforge.jp のアカウントで commit ができるための設定をしました。

    最初に試したのは

    でしたが Windows ではうまくいかなかったので再度調査。

    をすこし手直ししたら成功しました。

    • 以下 PC のアカウントは nishi で SF.jp のアカウントは nishimoto という想定。

    まず Windows XP のコントロールパネル「システム」で環境変数の設定。

    HOME=c:/cygwin/home/nishi
    CVSROOT=nishimoto@sourceforge.jp:/cvsroot/galatea
    CVS_RSH=ssh
    
    [cygwin]
    $ cd
    $ ssh-keygen
    /home/nishi/.ssh/identity
    $ notepad .ssh/idendity.pub
    

    これを sourceforge.jp の Account Maitainance で CVS/SVN/SSH Shared Authorized Keys に追加。

    環境変数が反映されるように新しい cygwin コンソールで確認します。

    $ ssh -l nishimoto cvs.sourceforge.jp
    (omitted)
    You cannot execute anything here.
    Connection to cvs.sourceforge.jp closed.
    
    $ ssh -l nishimoto shell.sourceforge.jp
    Last login: Sat Nov  1 14:38:37 2008 from xxxxxxxxxxxxxxxxxxxx
    nishimoto@sf-usr-shell:~$ ls
    galatea
    nishimoto@sf-usr-shell:~$ logout
    Connection to shell.sourceforge.jp closed.
    

    環境変数が反映されるように Eclipse を新たに起動します。

    • Window – Prefefence – Team – CVS – Ext connection method
      • CVS_RSH : c:\cygwin\bin\ssh.exe
      • Parameter : -l {user} {host}
      • SSH2 (General – Network Connections – SSH2)
        • SSH2 home: C:\cygwin\home\nishi\.ssh
        • Private Keys: C:\cygwin\home\nishi\.ssh\identity
    • New – Project – Project from CVS – New repository location
    Host: cvs.sourceforge.jp
    Repo Path: /cvsroot/galatea
    User: nishimoto
    Pass: (empty)
    Conn.Type: extssh
    

    repository の中身が見えたので成功。

    上記リンクと少し違う手順が必要でしたが、参考になりました。感謝。