小编Bul*_*Bul的帖子

错误LNK2019:未解析的外部符号

虽然我想编译我的opengl代码我得到以下错误:

Error   1   error LNK2019: unresolved external symbol __imp__glewInit@0 
Error   2   error LNK2019: unresolved external symbol __imp__glewGetErrorString@4 
Error   3   error LNK2001: unresolved external symbol __imp____glewAttachShader     
Error   4   error LNK2001: unresolved external symbol __imp____glewCompileShader    
Error   5   error LNK2001: unresolved external symbol __imp____glewCreateProgram    
Error   6   error LNK2001: unresolved external symbol __imp____glewCreateShader 
Error   7   error LNK2001: unresolved external symbol __imp____glewDeleteProgram    
Error   8   error LNK2001: unresolved external symbol __imp____glewDisableVertexAttribArray 
Error   9   error LNK2001: unresolved external symbol __imp____glewEnableVertexAttribArray  
Error   10  error LNK2001: unresolved external symbol …
Run Code Online (Sandbox Code Playgroud)

c c++ opengl compiler-errors visual-studio-2010

8
推荐指数
1
解决办法
5万
查看次数

Vulkan中的描述符集计数歧义

我想在vulkan中绘制两个对象.为此,我按照为每个模型创建两个不同描述符集的过程进行操作.但是,我对指定所需描述符集计数的结构感到困惑.困扰我的要点如下:

  1. VkDescriptorSetLayoutBinding指定描述符计数

    VkDescriptorSetLayoutBinding stagingLayoutBinding = {};
    ...
    stagingLayoutBinding.descriptorCount = 1;   <- i have one mat4 element for each descriptors 
    
    Run Code Online (Sandbox Code Playgroud)
  2. VkDescriptorPoolSize指定描述符计数

    VkDescriptorPoolSize stagingPoolSize = {};
    ...
    stagingPoolSize.descriptorCount = static_cast<uint32_t>(model.size());  <- allocate two descriptor sets from one descriptor pool
    
    Run Code Online (Sandbox Code Playgroud)
  3. VkDescriptorPoolCreateInfo中指定最大值集

    VkDescriptorPoolCreateInfo poolInfo = {};
    ...
    poolInfo.maxSets = model.size();   <- max descriptor sets = 2
    
    Run Code Online (Sandbox Code Playgroud)
  4. 最后在VkDescriptorSetAllocateInfo中指定描述符集创建

    VkDescriptorSetAllocateInfo allocInfo = {};
    ...
    allocInfo.descriptorSetCount = static_cast<uint32_t>(model.size());
    
    Run Code Online (Sandbox Code Playgroud)

但是,抛出异常vkAllocateDescriptorSets(device, &allocInfo, descriptorSet.data())并且验证层中的调试消息如下: -

validation Layer: Object: 0xcccccccccccccccc (Type …
Run Code Online (Sandbox Code Playgroud)

c++ 3d graphics vulkan

7
推荐指数
1
解决办法
428
查看次数

不明确的 OpenGL 默认相机位置

在我的Opengl程序中(在我应用透视投影矩阵之前)每当我绘制一些对象时,我都会在世界坐标系的原点处绘制它,但是几乎所有Opengl教程都指出相机(我的投影视图)位于原点朝向正 z 轴(这取决于稍后如何处理投影矩阵中的 z 值),但是如果这是真的,我的相机(位于原点)如何能够查看位于原点的对象。

注意:我需要这些信息,以便我移动世界并围绕原点旋转它,这样我就得到旋转相机的错觉。

opengl 3d opengl-es game-engine game-physics

6
推荐指数
1
解决办法
3668
查看次数

glut库中缺少glutInitContextVersion()

我正在练习一些opengl代码,但是当我想强制opengl上下文通过glutInitContextVersion()使用某个版本的opengl时,它会失败编译过程并给出这样的信息: -

使用未声明的标识符'glutInitContextVersion'

我想解决这个问题,所以我保持我的代码尽可能简单

#include "File.h"
#include <GLUT/GLUT.h>
#include <OpenGL/OpenGL.h>

using namespace std;

int  main ()
{

    glutInitContextVersion(3,2);

    return 1;
}
Run Code Online (Sandbox Code Playgroud)

但是,我能够使用其他过剩函数,没有任何错误或警告消息

我正在使用OS X 10.9.1在Macbook air上运行Xcode 4.4.1

c++ opengl macos glut undeclared-identifier

5
推荐指数
3
解决办法
6685
查看次数

使用SDL2指定OpenGL版本

我正在使用Mac OS Air OS X 10.9.2我的显卡是(Intel HD Graphics 4000 1024 MB)苹果声称Macbook air的规格与我的支持最高的Opengl 4.1你可以在这里阅读 - > http:// support.apple.com/kb/HT5942.但是当我使用SDL2并强制系统使用opengl 3.2时,当我通过glGetString()查询OpenGL版本时, 我得到以下行:

2.1 INTEL-8.24.11
Run Code Online (Sandbox Code Playgroud)

我的代码:

#include <iostream>
#include <SDL2/SDL.h>
#include <opengL/gl3.h>

using namespace std;


void sdldie(const char *msg)
{
printf("%s: %s\n", msg, SDL_GetError());
SDL_Quit();
exit(1);
}



void checkSDLError(int line = -1)
{
#ifndef NDEBUG
const char *error = SDL_GetError();
if (*error != '\0')
{
    printf("SDL Error: %s\n", error);
    if (line != -1)
        printf(" + line: %i\n", line);
    SDL_ClearError();
}
#endif …
Run Code Online (Sandbox Code Playgroud)

c++ opengl macos sdl

5
推荐指数
1
解决办法
3138
查看次数

困惑于Vulkan API中的渲染过程

最近我开始学习福尔康API,有一些话题让我困惑,我的问题是什么是一个渲染通道,为什么它是用命令缓冲区记录同时使用?什么是子传递,子传递依赖和附件?通常与渲染过程相关.

graphics vulkan

5
推荐指数
1
解决办法
4093
查看次数

无法使用vkCreateWin32SurfaceKHR创建vulkan曲面

我想将vulkan与SDL2一起使用,但我停留在曲面创建阶段,我无法使用vkCreateWin32SurfaceKHR扩展函数以及VkWin32SurfaceCreateInfoKHR扩展结构,因为它们未定义,但是使用其他扩展元素(vkGetPhysicalDeviceSurfaceSupportKHR,等等..),表面扩展是否需要单独的头文件?我如何使它工作?

我使用的预处理器指令如下

#include <vulkan\vulkan.h>
#include <SDL.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <exception>
#define VK_USE_PLATFORM_WIN32_KHR
Run Code Online (Sandbox Code Playgroud)

请注意,我没有使用任何程序就将vulkan与glfw一起使用,这是我第二次尝试运行vulkan,所以我认为我没有任何驱动程序支持问题。

c++ 3d game-engine sdl-2 vulkan

4
推荐指数
1
解决办法
1527
查看次数

Vulkan 中动态统一缓冲区的缓冲区内存分配

我想把这个问题分成 3 部分:-

  1. limit.minUniformBufferOffsetAlignment的概念是什么,为什么我们需要使用它来获取我们所需的对齐方式并从中导出缓冲区的偏移量?Vulkan 不能自动区分不同的数据类型和它们各自的对齐方式吗?

  2. 在 Sascha Willems 示例中,他计算了一个 4X4 矩阵的动态对齐,如下所示

    size_t uboAlignment = vulkanDevice->properties.limits.minUniformBufferOffsetAlignment
    dynamicAlignment = (sizeof(glm::mat4) / uboAlignment) * uboAlignment + ((sizeof(glm::mat4) % uboAlignment) > 0 ? uboAlignment : 0);
    
    Run Code Online (Sandbox Code Playgroud)

    一个 4X4 矩阵是 64 字节,允许的最小对齐大小是 256 字节,但据我所知,他的 dynamicAlignment 计算结果为 (64+256 = 320 //我认为这在 vulkan 中是不允许的) 我不太明白这个dynamicAlignment 是如何实现的计算工作

  3. 这个 dynamicAlignment 变量如何反映到

    VkBufferCreateInfo bufferInfo = {};
    bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
    bufferInfo.size = size;
    
    Run Code Online (Sandbox Code Playgroud)

    和内存映射之类的

    void * data;
    vkMapMemory(device, uniformStagingBufferMemory, 0, sizeof(matrix), 0, &data);
    memcpy(data, …
    Run Code Online (Sandbox Code Playgroud)

c++ game-engine game-physics vulkan

2
推荐指数
1
解决办法
2703
查看次数

如何在OpenGL 4.3中进行矩阵乘法?

是功能,如glmatrixmode(),gltranslate(),glrotate(),和glscale()在OpenGL 4.3过时?

如果不推荐使用,那么Core OpenGL配置文件中的哪些新函数可以进行矩阵操作?

opengl 3d

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

使用 Vulkan 中的纹理绘制多个对象

我想绘制一个场景,其中包含多个对象,每个对象都有自己的统一缓冲区和纹理,目前我能够使用动态统一缓冲区绘制多个对象,我这样做的方法是遍历动态统一缓冲区对象偏移量和索引命令缓冲区记录期间的顶点,这样我告诉 Vulkan 使用特定的全局矩阵绘制模型,但是我不知道如何在此操作期间绑定纹理信息,以便 Vulkan 知道为该对象使用正确的纹理,在我的示例中,我有四个具有四种不同纹理的盒子。

3d game-engine vulkan

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

vector push_back()给出了编译器错误C2280

我试图将自定义类对象附加到相同类型的向量,但是当我尝试编译我的代码时,编译器给出以下错误

gltf::gltf(const gltf &): attempting to reference a deleted function

我的函数接受一个字符串(文件名)作为参数并加载该文件,然后解析该文件并填充它的变量

功能如下: -

void enigma::loadModel(std::string file)
{       

    gltf stagingModel;
    stagingModel.loadAsset(file);   // populates my object with data
    model.push_back(stagingModel);  // appends the populated object to a vector array (this line generates the error)

    ....   // the rest of the code
}
Run Code Online (Sandbox Code Playgroud)

我的gltf类decleration如下: -

#pragma once
#include <iostream>
#include <vector>
#include <sstream>
#include <fstream>
#include "meshClass.h"
#include "bufferClass.h"
#include <gtx/quaternion.hpp>
#include <gtx/transform.hpp>

#include"stagingNodeClass.h"
#include"stagingMeshClass.h"
#include"stagingAccessorClass.h"
#include"stagingBufferViewClass.h"
#include"stagingImageClass.h"
#include"stagingSamplerClass.h"
#include"stagingTextureClass.h"
#include"stagingMaterialClass.h"
#include"stagingSkinClass.h"

class gltf …
Run Code Online (Sandbox Code Playgroud)

c++ vector c++11 c++14

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