再到 vscode user setting json 設定
"omnisharp.useGlobalMono": "always",
"omnisharp.monoPath": "/Library/Frameworks/Mono.framework/Versions/Current"
#include "GL/freeglut.h"
#include "GL/gl.h"
void renderFunction()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
glutCreateWindow("OpenGL - First window demo");
glutDisplayFunc(renderFunction);
glutMainLoop();
return 0;
}
g++ gltest.cc -lglut -lGL -o go
Before starting: Make sure you have the necessary folders and permissions — get more information.
/usr/local/src and download the source package.cd /usr/local/src
curl --remote-name http://www.openssl.org/source/openssl-1.0.2d.tar.gz
tar -xzvf openssl-1.0.2d.tar.gz
cd openssl-1.0.2d
/usr/local/openssl-1.0.2d../configure darwin64-x86_64-cc --prefix=/usr/local/openssl-1.0.2d
make
make install
/usr/local/openssl to /usr/local/openssl-1.0.2d.ln -s openssl-1.0.2d /usr/local/openssl
echo 'export PATH=/usr/local/openssl/bin:$PATH' >> ~/.bash_profile
echo 'export MANPATH=/usr/local/openssl/ssl/man:$MANPATH' >> ~/.bash_profile
source ~/.bash_profile
security find-certificate -a -p /Library/Keychains/System.keychain > /usr/local/openssl/ssl/cert.pem
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> /usr/local/openssl/ssl/cert.pem
openssl version -a