05 2016 档案
摘要:对于COM对象来说使用传统指针比较麻烦,还要记得Release()防止内存泄漏,一不小心就会出现各种各样的问题。针对这种问题微软提供了对于COM对象的智能指针ComPtr,这里是官方文档https://github.com/Microsoft/DirectXTK/wiki/ComPtr 举个例子,原
阅读全文
摘要:由于之前一直在看directx11龙书学习,因此sdk一直用的Microsoft DirectX SDK (June 2010) 版本,最近在stackoverflow上问dx11相关问题时,一直被大神吐槽为何还用已经废弃的directx sdk,由于directx sdk现在已经和windows
阅读全文
摘要:本文由zhangbaochong原创,转载请注明出处http://www.cnblogs.com/zhangbaochong/p/5510294.html 上一个教程我们实现了渲染一个会旋转的立方体,这次我们来实现一个简单地形。 先来看看最终实现效果吧(蓝色是背景色,地形的不同高度分别渲染了不同颜色
阅读全文
摘要:题目: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
阅读全文
摘要:题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: But the
阅读全文
摘要:对于一颗二叉树,深度优先搜索(Depth First Search)是沿着树的深度遍历树的节点,尽可能深的搜索树的分支。以上面二叉树为例,深度优先搜索的顺序 为:ABDECFG。怎么实现这个顺序呢 ?深度优先搜索二叉树是先访问根结点,然后遍历左子树接着是遍历右子树,因此我们可以利用堆栈的先进后出的特
阅读全文
摘要:题目: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the
阅读全文
摘要:上一次我们学习了如何画一个2D三角形,现在让我们进一步学习如何画一个旋转的彩色立方体吧。 具体流程同画三角形类似,因此不再给出完整代码了,不同的部分会再说明。 由于我们要画彩色的立方体,所以顶点结构体中加入颜色变量 着色器代码 定义了一个矩阵gWorldViewProj,后面我们会利用它进行旋转立方
阅读全文
摘要:题目: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given
阅读全文
摘要:这里不再介绍effect框架的具体使用,有关effect框架使用可参考http://www.cnblogs.com/zhangbaochong/p/5475961.html 实现的功能依然是画一个简单的三角形,只不过使用了effect框架。 为了体现使用effect框架方便变量绑定的优点,我们对着色
阅读全文
摘要:xnamath.h 报错: 在标识符“XMConvertToRadians”的前面 如下报错 解决方法 将 #include <xnamath.h>头文件放到 #include <D3D11.h>#include <d3dx11.h>#include <DxErr.h>#include <D3DCo
阅读全文
摘要:最近尝试用了下Directx下的Effect框架,作为一初学者初学者,说下为什么我们要使用Effect框架及其好处吧。 最近尝试用了下Directx下的Effect框架,作为一初学者初学者,说下为什么我们要使用Effect框架及其好处吧。 首先Effect最大好处的就是简单,使得编写Shader绘制
阅读全文
摘要:题目: Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2
阅读全文
摘要:题目: Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2
阅读全文
摘要:题目: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integ
阅读全文