<commit_before>/*
 * GLContext.h
 * 
 * This file is part of the "LLGL" project (Copyright (c) 2015 by <NAME>)
 * See "LICENSE.txt" for license information.
 */

#ifndef LLGL_GL_CONTEXT_H
#define LLGL_GL_CONTEXT_H


#include <LLGL/Surface.h>
#include <LLGL/RenderContextDescriptor.h>
#include <memory>
#include "../RenderState/GLStateManager.h"


namespace LLGL
{


class GLContext
{

    public:

        virtual ~GLContext();

        // Creates a platform specific GLContext instance.
        static std::unique_ptr<GLContext> Create(RenderContextDescriptor& desc, Surface& surface, GLContext* sharedContext);

        // Makes the specified GLContext current. If null, the current context will be deactivated.
        static bool MakeCurrent(GLContext* context);

        // Returns the active GLContext instance.
        static GLContext* Active();

        // Sets the swap interval for vsync (Win32: wglSwapIntervalEXT, X11: glXSwapIntervalSGI).
        virtual bool SetSwapInterval(int interval) = 0;

        // Swaps the back buffer with the front buffer (Win32: ::SwapBuffers, X11: glXSwapBuffers).
        virtual bool SwapBuffers() = 0;

        // Resizes the GL context. This is called after the context surface has been resized.
        virtual void Resize(const Size& resolution) = 0;

        inline const std::shared_ptr<GLStateManager>& GetStateManager() const
        {
            return stateMngr_;<commit_msg>Minor changeö<commit_after>/*
 * GLContext.h
 * 
 * This file is part of the "LLGL" project (Copyright (c) 2015 by <NAME>)
 * See "LICENSE.txt" for license information.
 */

#ifndef LLGL_GL_CONTEXT_H
#define LLGL_GL_CONTEXT_H


#include <LLGL/Surface.h>
#include <LLGL/RenderContextDescriptor.h>
#include <memory>
#include "../RenderState/GLStateManager.h"


namespace LLGL
{


// Base wrapper class for an GL context.
class GLContext
{

    public:

        virtual ~GLContext();

        // Creates a platform specific GLContext instance.
        static std::unique_ptr<GLContext> Create(RenderContextDescriptor& desc, Surface& surface, GLContext* sharedContext);

        // Makes the specified GLContext current. If null, the current context will be deactivated.
        static bool MakeCurrent(GLContext* context);

        // Returns the active GLContext instance.
        static GLContext* Active();

        // Sets the swap interval for vsync (Win32: wglSwapIntervalEXT, X11: glXSwapIntervalSGI).
        virtual bool SetSwapInterval(int interval) = 0;

        // Swaps the back buffer with the front buffer (Win32: ::SwapBuffers, X11: glXSwapBuffers).
        virtual bool SwapBuffers() = 0;

        // Resizes the GL context. This is called after the context surface has been resized.
        virtual void Resize(const Size& resolution) = 0;

        inline const std::shared_ptr<GLStateManager>& GetStateManager() const
        {
            return stateMngr_;
{'fraction_non_alphanumeric': 0.08978328173374613, 'fraction_numerical': 0.010319917440660475, 'mean_word_length': 3.1483594864479314, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2357550', 'n_tokens_mistral': 858, 'n_tokens_neox': 805, 'n_words': 279}