小编gre*_*xal的帖子

野牛转移减少冲突,我不知道在哪里

语法:http ://pastebin.com/ef2jt8Rg y.output:http://pastebin.com/AEKXrrRG

我不知道那些冲突在哪里,有人可以帮我这个吗?

reduce parsing conflict bison shift

3
推荐指数
1
解决办法
4068
查看次数

GetProcAddress奇怪的返回地址

有人解释为什么下一个代码在ntdll.dll中返回一个指针?

GetProcAddress(LoadLibraryA("kernel32.dll"), "EncodePointer");
GetProcAddress(LoadLibraryA("kernel32.dll"), "DecodePointer");
Run Code Online (Sandbox Code Playgroud)

PS:如果调用kernel32的export表指向的函数,则抛出一个断点.

c windows loadlibrary getprocaddress pointer-address

0
推荐指数
2
解决办法
1490
查看次数

GLSL纹理不起作用

考虑以下:

virtual void Draw()
{
    _texture->Bind(0);

    _shader->Begin();
    _shader->SetUniform("WVPMatrix", _mvp);
    _shader->SetUniform("InColor", _color);
    _shader->SetUniformImm("InTexture", 0);
    _vbo.GetDeclaration().Activate();
    _vbo.Render(GL_QUADS, _ibo, 4);
    _shader->End();
}

void Texture2D::Bind(int index)
{
    if (index != -1)
    {
        glActiveTexture(GL_TEXTURE0 + index);
    }

    glBindTexture(GL_TEXTURE_2D, _textureID);
}
Run Code Online (Sandbox Code Playgroud)

在哪里调用_shader-> Begin(),_ shader-> SetUniform,_shader-> SetUniformImm,_vbo.GetDeclaration().激活和_vbo.Render就像我设置片段着色器以呈现静态颜色(甚至颜色)一样通过制服)它变得很好.

现在我正在尝试渲染一个texture2d(它加载得很好,我用立即模式测试)然后我得到一个黑屏,为什么?

顶点:

#version 330

layout(location = 0) in vec3 VertexPosition;
layout(location = 1) in vec2 VertexTexCoord;

uniform mat4 WVPMatrix;

out vec2 TexCoord0;

void main()
{
    TexCoord0 = VertexTexCoord;

    gl_Position = WVPMatrix * vec4(VertexPosition, 1);
}
Run Code Online (Sandbox Code Playgroud)

分段:

#version 330

in vec2 …
Run Code Online (Sandbox Code Playgroud)

c++ opengl glsl

0
推荐指数
1
解决办法
1597
查看次数