2012年5月1日 星期二

OpenGL 貼圖錯誤!?

最近開始進行用 OpenGL 實作 2D 圖形庫, 在開發過程出現了一個困擾的錯誤:

連續兩個四邊型(由兩三角形組成)物件各使用各自不同的貼圖, 但顯示後卻都是同一張圖!!

我花了很多時間想要找出哪裡作錯, 是我 glBindTexture 用錯導致? 是我不熟悉 OpenGL 的 pipeline 流程?

後來我換了電腦測試, 同一個 exe 在公司裡的電腦執行是正確的!

我越發奇怪,想真的是我不懂 OpenGL 了, 我開始找了網路最簡單的 texture 範例 (NeHe網站), 人家可是 OpenGL 高手可以了吧, 我改了一下把他的範例原是一張貼圖, 弄成貼兩張不同圖, 結果在家裡的電腦跑還是一樣出錯!

我又把該修改範例的 exe 丟給我朋友測試, 他說他那邊正常!

2012年3月21日 星期三

Eclipse+Android SDK/NDK 開發環境的過程 (1/2)

後記: 

02/11/2014, 我重灌電腦, 再度安裝 andriod 開發環境, 發現 andriod 官網已經把下述之 Eclipse IDE 跟 SDK (step 7~21) 整合成一個 adt-bundle 了, 下載該包後, 解壓縮到硬碟任何地方即可以. (但前提 JRE 還是要先裝), 我沒有再新建專案, 去測試剩餘的步驟的有無差異. 
參見再度安裝 andriod 開發環境



-------------------
Eclipse+Android SDK/NDK 開發環境的過程

以下為我記錄第一次就搞定 Eclipse + Android SDK/NDK 開發環境的過程

時間為 2012/3/21 當時下載的最新版軟體及 SDK

其實在參照人家分享的過程中, 我發現

1. Cygwin 根本不用裝到 devel 整個套件
2. 不必修改任何 Cygwin 的 bash profile 檔案, 就可以讓 ndk 正常運作, 可
   能是我習慣 "不用多做的事情盡量不要做" 吧, 所以試著少做一些看看...


以下:
p.s. 這是記錄日誌, 不是教學~
--------------------------------------------------------------------

1. 下載 Java SE(Standard Edition) Development Kit
   url: http://www.oracle.com/technetwork/java/javase/downloads/
   ref: jdk-7u3-windows-i586.exe (84.1MB)

2. 下載 Eclipse IDE for Java Developers
   url: http://www.eclipse.org/downloads/
   ref: eclipse-java-indigo-SR2-win32.zip (128MB)

3. 下載 Android SDK
   url: http://developer.android.com/sdk/
   ref: android-sdk_r16-windows.zip (28.1MB)
        installer_r16-windows.exe (28.1MB)

4. 下載 Android NDK
   (*** only needed for developing C/C++ native code libraries ***)
   url: http://developer.android.com/sdk/ndk/
   ref: android-ndk-r7b-windows.zip (76.6MB)

   NOTE: 開發 NDK 還需要有 GNU 的 bash 和 make 工具, Windows 下可以安
         裝 Cygwin 環境

   下載 Cygwin (only needed for NDK)
   url: http://cygwin.com/install.html
   ref: setup.exe (681KB)

2012年2月23日 星期四

SVN folder as sub module of GIT

這是上一篇中 '方法B' 的筆記

1) Prepare svn:// protocol:

(NOTE: don't use file:/// because it might has file format compilable problem)

In my case:

    1. svn repo at d:\work\repo\my_projects

    2. set svn service (I had set root at d:\work\repo) and make sure service was activated

    3. test svn checkout from svn://localhost/my_projects (or relative to yout root  in step2) has no polblem

    where repo tree is like:

    svn://my_projects/bla1/...
                     /bla2/...
                     /src/boo1/...
                     /src/boo2/...
                     /src/boo3/...
                     /src/...


    (NOTE: I don't use /trunk /branches /tags naming layout)
 

2) Purpose: 

the svn://my_projects/src/boo3/* is the library part, I need it to be used as

a git clone where in d:\work\my_test\boo3-clone

so git://d:\work\my_test\boo3-clone

will sync to/and from svn://localhost/my_projects/src/boo3


3)  using msysgit:

1. use GIT for windows' 'GIT bash here' at d:\work\my_test

2. use 'git svn clone url_of_svn_repo folde_rname

(NOTE: if using /trunk /branches /tags naming layout, use 'git svn clone -s ...' as -s is -stdlayout)

3. in my case

$ git svn clone svn://localhost/my_projects/src/boo3 boo3-clone
Initialized empty Git repository in d:/work/my_test/boo3-clone/.git/
r75 = 1324d83fab0b6d93f526b8f8252e8404d49c9e08 (refs/remotes/git-svn)
        A       boo3.vcxproj.user
...
        A       boo3.dsw
        A       boo3.vcxproj.filters
        A       boo3.dsp
r80 = 9f6afc8b5c2d68c4901de44a99e946b9edab5926 (refs/remotes/git-svn)
..
        M       boo3.dsp
r81 = cbb1be75466bfb695c76c8366828af3fd7c03a80 (refs/remotes/git-svn)
Checked out HEAD:
  svn://localhost/my_projects/src/boo3 r81


4. so now d:\work\my_test\boo3-clone had filled as a git repo where all files/folders/logs

   are the same as svn's

Ref: 使用 git-svn 整合 git 與 svn



 4) Another example by using TortoiseGit:

1. git svn clone setup


2. git svn clone done


3. add submodule