Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED HELP FIXING C++ Hell I am desperately trying to build a window in XCode using GLFW and GLEW but there are several issues wrong

NEED HELP FIXING C++

Hell I am desperately trying to build a window in XCode using GLFW and GLEW but there are several issues wrong with my code. Please help

#include

//GLEW

#define GLEW_STATIC

#include

//GLFW

#include

#define GLFW_INCLUDE_GLCOREARB

#include

#if defined(GLFW_INCLUDE_GLEXT)

#include

#endif

int main(void)

{

GLFWwindow* window;

/* Initialize the library */

if (!glfwInit())

return -1;

/* Create a windowed mode window and its OpenGL context */

window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);

if (!window)

{

glfwTerminate();

return -1;

}

/* Make the window's context current */

glfwMakeContextCurrent(window);

/* Loop until the user closes the window */

while (!glfwWindowShouldClose(window))

{

/* Render here */

glClear(GL_COLOR_BUFFER_BIT);

/* Swap front and back buffers */

glfwSwapBuffers(window);

/* Poll for and process events */

glfwPollEvents();

}

glfwTerminate();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Proficiency with Microsoft Word, Excel, PowerPoint

Answered: 1 week ago