Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 6454151bd41eb2c7e1dfc079b90f27fc62be77d6 authored by Philip Trettner on 17 April 2022, 08:24:26 UTC, committed by Philip Trettner on 17 April 2022, 08:24:26 UTC
Merge branch 'update_xxhash' into 'develop'
Update xxHash source files

See merge request Glow/glow!40
2 parent s 8f61a37 + af981cf
  • Files
  • Changes
  • 20faf00
  • /
  • src
  • /
  • glow
  • /
  • gl.cc
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:6454151bd41eb2c7e1dfc079b90f27fc62be77d6
directory badge
swh:1:dir:4dbe848fb2f53011527987843e05c7c3a241e095
content badge
swh:1:cnt:bc938f15849b1bca133d6665405ef60fa0285658

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
gl.cc
#include "gl.hh"

#include "glow.hh"
#include "limits.hh"

void glow::restoreDefaultOpenGLState()
{
    checkValidGLOW();

    // The initial value for each capability with the exception of GL_DITHER and GL_MULTISAMPLE is GL_FALSE.
    glDisable(GL_BLEND);
    glDisable(GL_COLOR_LOGIC_OP);
    glDisable(GL_CULL_FACE);
    // Do NOT disable debug output if set!
    // glDisable(GL_DEBUG_OUTPUT);
    // glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
    glDisable(GL_DEPTH_CLAMP);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_FRAMEBUFFER_SRGB);
    glDisable(GL_LINE_SMOOTH);
    glDisable(GL_POLYGON_OFFSET_FILL);
    glDisable(GL_POLYGON_OFFSET_LINE);
    glDisable(GL_POLYGON_OFFSET_POINT);
    glDisable(GL_POLYGON_SMOOTH);
    glDisable(GL_PRIMITIVE_RESTART);
    glDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
    glDisable(GL_RASTERIZER_DISCARD);
    glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
    glDisable(GL_SAMPLE_ALPHA_TO_ONE);
    glDisable(GL_SAMPLE_COVERAGE);
#if GLOW_OPENGL_VERSION >= 40
    glDisable(GL_SAMPLE_SHADING);
#endif
    glDisable(GL_SAMPLE_MASK);
    glDisable(GL_SCISSOR_TEST);
    glDisable(GL_STENCIL_TEST);
    glDisable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
    glDisable(GL_PROGRAM_POINT_SIZE);

    // The initial value for GL_DITHER and GL_MULTISAMPLE is GL_TRUE.
    glEnable(GL_DITHER);
    glEnable(GL_MULTISAMPLE);

    // clear
    glClearColor(0.f, 0.f, 0.f, 0.f);

    // blending
    glBlendFunc(GL_ONE, GL_ZERO);
    glBlendColor(0.f, 0.f, 0.f, 0.f);
    glBlendEquation(GL_FUNC_ADD);

    // logic op
    glLogicOp(GL_COPY);

    // depth test
    glDepthMask(GL_TRUE);
    glDepthFunc(GL_LESS);
    glClearDepth(1.0);
    glDepthRange(0.0, 1.0);

    // culling
    glCullFace(GL_BACK);
    glFrontFace(GL_CCW);

    // point/line width
    glLineWidth(1.f);
    glPointSize(1.f);

    // sample cov
    glSampleCoverage(1.f, GL_FALSE);

    // poly offset
    glPolygonOffset(0.f, 0.f);

    // prim restart (has no default)
    // glPrimitiveRestartIndex()

    // stencil test
    glStencilFunc(GL_ALWAYS, 0, 0xFFffFFff);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);

    // default pixel store
    glPixelStorei(GL_PACK_SWAP_BYTES, false);
    glPixelStorei(GL_PACK_LSB_FIRST, false);
    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
    glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0);
    glPixelStorei(GL_PACK_SKIP_ROWS, 0);
    glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
    glPixelStorei(GL_PACK_SKIP_IMAGES, 0);
    glPixelStorei(GL_PACK_ALIGNMENT, 4);

    glPixelStorei(GL_UNPACK_SWAP_BYTES, false);
    glPixelStorei(GL_UNPACK_LSB_FIRST, false);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
    glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
    glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
    glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
    glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 4);

    // seamless cubemap filtering
    glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
}

void glow::unbindOpenGLObjects()
{
    // unbind shader
    glUseProgram(0);

    // unbind VAOs
    glBindVertexArray(0);

    // unbind textures
    for (auto i = 0; i < limits::maxCombinedTextureImageUnits; ++i)
    {
        glActiveTexture(GL_TEXTURE0 + i);
        glBindTexture(GL_TEXTURE_1D, 0);
        glBindTexture(GL_TEXTURE_2D, 0);
        glBindTexture(GL_TEXTURE_3D, 0);
        glBindTexture(GL_TEXTURE_1D_ARRAY, 0);
        glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
        glBindTexture(GL_TEXTURE_RECTANGLE, 0);
        glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
        glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, 0);
        glBindTexture(GL_TEXTURE_BUFFER, 0);
        glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
        glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0);
    }

    // unbind samplers
    for (auto i = 0; i < limits::maxCombinedTextureImageUnits; ++i)
        glBindSampler(i, 0);

    // activate tex0 again
    glActiveTexture(GL_TEXTURE0);

    // unbind buffers
    // must be last: otherwise unbinding EAB changes VAO
    glBindBuffer(GL_ARRAY_BUFFER, 0);
    glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, 0);
    glBindBuffer(GL_COPY_READ_BUFFER, 0);
    glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
    glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, 0);
    glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
    glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
    glBindBuffer(GL_QUERY_BUFFER, 0);
    glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
    glBindBuffer(GL_TEXTURE_BUFFER, 0);
    glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, 0);
    glBindBuffer(GL_UNIFORM_BUFFER, 0);
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API