小编Ali*_*kar的帖子

Visual Studio - 调试程序断点移动,不再符合它们应该的行

目前,我在视觉工作室的一个程序中看到了一个奇怪的功能.VS允许我在文件中的某些点放置断点,但是在调试模式下它将这些断点移动到空格和注释.

我已经尝试过的事情:

  1. 删除了PDB文件并重建.
  2. 删除了EXE文件并重建.
  3. 重建整个项目.(清洁,重建)
  4. 检查优化已关闭.
  5. 检查调试路径是否与构建输出路径相同.
  6. 选中"要求源文件与原始版本完全匹配"标志.

如果我的代码中只有一些奇怪的东西导致这是它发生的功能:

bool BManager::Record(string _strFile)
{
   bool bSuccess = false;
   CBitmap * bitmap = new CBitmap();
   HBITMAP  handle = NULL;
   HPALETTE hPalette = NULL;
   //LoadBitmapFromBMPFile( (LPTSTR)_strFile.c_str(), &handle, &hPalette);
   ofstream out;
   out.open(_strFile.c_str());

   handle = (HBITMAP)LoadImage(NULL, (LPTSTR)_strFile.c_str(), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE);

   bitmap->FromHandle(handle);
   bSuccess = ImageBitmap_Record(bitmap);
   delete bitmap;
   bitmap = NULL;
   CloseHandle(handle);
   return bSuccess;
}
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?

c++ visual-studio-2010

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

XNA Xbox 360内容管理器线程冻结绘制线程

我目前有一款游戏可以拍摄大于1MB的大图像作为背景.我确切知道何时应该进行这种转换,所以我创建了一个加载器类来处理在后台加载这些大图像,但是当我加载图像时它仍然会冻结绘图发生的主线程.由于此代码在360上运行,我将线程移动到第4个硬件线程,但这似乎没有帮助.以下是我正在使用的课程.任何想法为什么我的新内容管理器应该在自己的线程中打断我的主线程中的绘制将不胜感激.

namespace FileSystem  
{
/// <summary>
/// This is used to reference how many objects reference this texture.
/// Everytime someone references a texture we increase the iNumberOfReferences.
/// When a class calls remove on a specific texture we check to see if anything
/// else is referencing the class, if it is we don't remove it. If there isn't 
/// anything referencing the texture its safe to dispose of.
/// </summary>
class TextureContainer
{
    public uint uiNumberOfReferences = 0; …
Run Code Online (Sandbox Code Playgroud)

c# xna multithreading file-management

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

黑屏OpenGL

我正在尝试学习如何使用着色器程序在OpenGL 2.0中进行一些基本渲染,并且我很难将任何顶点数据显示在屏幕上.现在我不知道我的问题所在.我已经通过了一些例子,在我的代码中没有任何明显的突出显示错误,但我确信我错过了一些简单的东西.我会尝试简短地使用我的代码.

我在这里也问了同样的问题:gamedev.stackexchange,但遗憾的是我还没有收到任何能解决我问题的答案.

尝试答案的快速摘要:

  1. 我可以将背景颜色清除为红色,所以我知道我的显示代码有效.
  2. 摄像机代码不会修改矩阵堆栈.
  3. 没有着色器编译器错误.

谢谢你的帮助.

bool GameCore::Start(int iCmdShow)
{
    const LPCWSTR appname = TEXT("Maze Game");
    // Create the Window and kill the program if this fails.
    if(!wm->Create(appname))
    {
        return FALSE;
    }

    // Initialize OpenGL
    wm->InitGraphics();
    cam = wm->cam;

    Vector3 *v = new Vector3(0.0f,0.0f,0.0f);
    wm->testSprite = new Sprite(v);

    // Start the update loop.
    _beginthread(&GameCore::Execute, 0, this);

    // Blocking function to run the application.
    wm->RunWindow(iCmdShow);
    return true;
}

// Initialize OpenGL graphics
void OpenGLWM::InitGraphics()
{
    hDC = …
Run Code Online (Sandbox Code Playgroud)

c++ opengl

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