MCPcopy Create free account
hub / github.com/cginternals/globjects / initialize

Function initialize

source/examples/computeshader/main.cpp:49–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49void initialize()
50{
51 g_texture = globjects::Texture::createDefault(GL_TEXTURE_2D);
52 g_texture->image2D(0, GL_R32F, 512, 512, 0, GL_RED, GL_FLOAT, nullptr);
53 g_texture->bindImageTexture(0, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_R32F);
54 g_texture->setParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST);
55 g_texture->setParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST);
56 g_texture->ref();
57
58 g_computeProgram = new globjects::Program();
59
60 const auto dataPath = common::retrieveDataPath("globjects", "dataPath");
61 g_computeProgram->attach(globjects::Shader::fromFile(GL_COMPUTE_SHADER, dataPath + "computeshader/cstest.comp"));
62 g_computeProgram->setUniform("destTex", 0);
63 g_computeProgram->ref();
64
65 g_quad = new ScreenAlignedQuad(g_texture);
66 g_quad->setSamplerUniform(0);
67 g_quad->ref();
68}
69
70void deinitialize()
71{

Callers 2

ScreenAlignedQuadMethod · 0.70
mainFunction · 0.70

Calls 6

bindImageTextureMethod · 0.80
refMethod · 0.80
attachMethod · 0.80
image2DMethod · 0.45
setParameterMethod · 0.45
setSamplerUniformMethod · 0.45

Tested by

no test coverage detected