それっぽい処理はできたのですが、太さを設定できるようにすると
斜線時に細く見えてしまう気がします。
こちら原因が分かる方おりませんでしょうか。
width引数が太さに当たります。
void DrawLine( int x1, int y1, int x2, int y2, int width, int color, int alpha ){
int r = color >> 16;
int g = (color >> 8) & 0xff;
int b = color & 0xff;
const GLfloat squareVertices[] = {
x1, y1,
x2, y2,
};
const GLubyte squareColors[] = {
r, g, b, alpha,
r, g, b, alpha,
};
// ブレンディングのセット
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glLineWidth( width );
glVertexPointer(2, GL_FLOAT, 0, squareVertices);
glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(GL_LINES, 0, 2);
// ブレンディングの解除
glDisable( GL_BLEND );
}