How do I enable multisampling using glfw in Python?

Question:

I am trying to enable 4x multisampling for OpenGL in Python. But I keep getting an error saying "GFLW_SAMPLES" is not defined. The way I understand it this should be included in glfw.

from OpenGL.GL import *
import glfw
import sys

glfw.window_hint(GLFW_SAMPLES, 4)

Is there another library I have to import for this?

Asked By: JJBeaudry

||

Answers:

You have 2 possibilities:

import glfw

glfw.window_hint(glfw.SAMPLES, 4)

or

from glfw.GLFW import *

glfwWindowHint(GLFW_SAMPLES, 4)
Answered By: Rabbid76
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.