2013年11月1日 星期五

自動將圖片 複製成retina專用的圖

在iOS中,Retina的圖都是以@2x為區分,
為了省去麻煩,我做了一個automator。

2013年9月13日 星期五

使用Bitbucket來免費託管靜態網站

很簡單,只要建立一個『你的帳號』.bitbucket.org的repository就可以了
詳細說明,看這裡。

TortoiseHg 快速入門

  • Clone
    • 指令

      • hg clone https://yourdomain@bitbucket.org 
    •  TortoiseHg
      • 桌面滑鼠右鍵,TortoiseHg,Clone...
      •  貼上來源,拓製
  •  Commit
    • 指令
      • hg commit -m "Initial commit"
    • TortoiseHg
      • 在資料夾上,點滑鼠右鍵,commit
      • 選擇檔案,填上註解
  • push
    • 指令
      • pushing to https://yourdomain@bitbucket.org/
    • TortoiseHg
      • 在資料夾上,點滑鼠右鍵,Hg WorkBench
      • 選擇要push的branch,按push鍵

2013年7月12日 星期五

IOS autorelease 錯誤

使用autorelease一直有錯誤
ARC forbids explicit message send of'release'
'release' is unavailable: not available inautomatic reference counting mode

2013年3月11日 星期一

immediate mode? display list? vertex array?

  • immediate mode
    • The easiest way to do drawing in OpenGL is using the Immediate Mode. For this, you use the glBegin() function which takes as one parameter the “mode” or type of object you want to draw.
    • glBegin(GL_LINE_LOOP);//start drawing a line loop
          glVertex3f(-1.0f,0.0f,0.0f);//left of window
          glVertex3f(0.0f,-1.0f,0.0f);//bottom of window
          glVertex3f(1.0f,0.0f,0.0f);//right of window
          glVertex3f(0.0f,1.0f,0.0f);//top of window
      glEnd();//end drawing of line loop
  • display list
    • Display list is a group of OpenGL commands that have been stored (compiled) for later execution. Once a display list is created, all vertex and pixel data are evaluated and copied into the display list memory on the server machine. It is only one time process. After the display list has been prepared (compiled), you can reuse it repeatedly without re-evaluating and re-transmitting data over and over again to draw each frame.
    • // create one display list
      GLuint index = glGenLists(1);
      // compile the display list, store a triangle in it
      glNewList(index, GL_COMPILE);
          glBegin(GL_TRIANGLES);
              glVertex3fv(v0);
              glVertex3fv(v1);
              glVertex3fv(v2);
          glEnd();
      glEndList();
      ...
      // draw the display list
      glCallList(index);
  • vertex array
    • This means that your vertices and vertex attributes and indices are in RAM.
    • glEnableClientState(GL_VERTEX_ARRAY);
      glEnableClientState(GL_COLOR_ARRAY);
      glColorPointer(3, GL_FLOAT, 0, Colors);
      glVertexPointer(3, GL_FLOAT, 0, Vertices);
      glDrawArrays(GL_TRIANGLES, 0, 3);
      glDisableClientState(GL_VERTEX_ARRAY);
      glDisableClientState(GL_COLOR_ARRAY);
Vertex Buffer Object (VBO)