Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[MFC]COLORREF給glColor_xx()使用

目前在網路上找到得資料,都沒有可以直接轉換的函式。
目前有找到個算是偷吃步的作法,就是重新把COLORREF內部的R、G、B重新取出。
使用的介面名稱為GetRValue()GetGValue()GetBValue()

不過取出的R、G、B值皆為BYTE型態,因此直接塞給GL是不能使用的。
這邊有測試過glColor3b()glColor3i(),結果都是不可行的。

所以變成只能使用glColor3f()來設定顏色。

但由於glColor3f()只能輸入float,所以要再把取得到的R、G、B再除於255轉換成float。
不過一次要做三個除法,所以當繪製的圖形一多,或許會有效能的問題,這邊還需在想要如何處理會比較適合。

範例如下:
 ....  
     glColor3f(GetRValue(clrSelectedColor*1.0f/255,   
              GetGValue(clrSelectedColor)*1.0f/255,  
              GetBValue(clrSelectedColor)*1.0f/255);  
 ....  

Comments

Popular Posts