feat: working glfw hello world

This commit is contained in:
Krzysztof Rudnicki 2022-08-28 18:40:39 +02:00
parent a03099eb23
commit 8f60f623cd
3 changed files with 7 additions and 14 deletions

14
.vscode/tasks.json vendored
View File

@ -5,18 +5,10 @@
"label": "C/C++: g++-11 build active file", "label": "C/C++: g++-11 build active file",
"command": "/usr/bin/g++", "command": "/usr/bin/g++",
"args": [ "args": [
"-lGL", "-lm", "-Wall", "${workspaceFolder}/Engine/engine/*.cpp",
"-lX11", "-lpthread", "-lXi", "-lXrandr", "-ldl",
"-std=c++17",
"-fdiagnostics-color=always",
"-Wall",
"-g",
"-I${workspaceFolder}/dependencies/include",
"-LI${workspaceFolder}/dependencies/library",
"${workspaceFolder}/dependencies/library/libglfw3.a",
"${workspaceFolder}/Engine/engine/*.cpp",
"-o", "-o",
"${workspaceFolder}/app", "${workspaceFolder}/Engine/engine/match", "-lglfw", "-lGLU", "-lGL", "-lm",
], ],
"options": { "options": {
"cwd": "${fileDirname}" "cwd": "${fileDirname}"

Binary file not shown.

View File

@ -1,15 +1,16 @@
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
int main(void) int main(void)
{ {
GLFWwindow* window; GLFWwindow* window;
/* Initialize the library */ /* Initialize the library */
if (!glfwInit()) if (!glfwInit())
{
return -1; return -1;
}
/* Create a windowed mode window and its OpenGL context */ /* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); window = glfwCreateWindow(640, 480, "xD", NULL, NULL);
if (!window) if (!window)
{ {
glfwTerminate(); glfwTerminate();