DX9 DirectX鼠标控制程序 代码
代码实例1:
// @time: 2012.3.26
// @author: jadeshu
// des: DirectX鼠标控制程序
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <atlstr.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#define ReleaseD3D(x) if (x!=NULL){x->Release();x=NULL;}
#pragma comment(lib,"winmm.lib")
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dinput8.lib")
#pragma comment(lib, "dxguid.lib")
//全局变量
TCHAR g_szWindowName[]=_T("DirectX鼠标控制程序");
BOOL bActive = TRUE;
DIMOUSESTATE g_diMousestate={0};
//定义设备接口
IDirect3DDevice9 * g_pd3dDevice=NULL;
LPDIRECTINPUT8 g_pDirectInput=NULL; //DirectInput接口
LPDIRECTINPUTDEVICE8 g_pMouseDevice=NULL; //键盘输入接口
LPD3DXMESH g_pMeshTeapot=NULL; //茶壶网格对象
//回调函数声明
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
//初始化Direct3D函数声明
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance);
//渲染声明
VOID Render();
//清除对象声明
VOID Cleanup();
//读取设备的输入数据
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize);
//主函数
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
//定义窗口类结构
TCHAR szAppName[]=TEXT("ClassN");
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
ZeroMemory(&msg,sizeof(msg));
wc.cbClsExtra=0;
wc.cbSize=sizeof(WNDCLASSEX);
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hCursor=LoadCursor(hInstance,IDC_ARROW);
wc.hIcon=LoadIcon(hInstance,IDI_APPLICATION);
wc.hIconSm=NULL;
wc.hInstance=hInstance;
wc.lpfnWndProc=WinProc;
wc.lpszClassName=szAppName;
wc.lpszMenuName=NULL;
wc.style=CS_HREDRAW|CS_VREDRAW;
//注册窗口
RegisterClassEx(&wc);
//创建窗口
hwnd=CreateWindow(szAppName,g_szWindowName,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,0);
//加载3D初始化
if (FAILED(Init3D(hwnd,hInstance)))
{
return FALSE;
}
//显示和更新窗口
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
//消息循环
while (WM_QUIT!=msg.message)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
//转换消息
TranslateMessage(&msg);
//投递消息
DispatchMessage(&msg);
}
else if(bActive)
{
//渲染
Render();
}
else
{
if(!WaitMessage())
return -1;
}
}
//删除注册窗口
UnregisterClass(szAppName,hInstance);
return msg.wParam;
}
//回调函数
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch (uMsg)
{
case WM_PAINT:
Render(); //渲染
ValidateRect(hwnd,NULL); //更新窗口
return 0;
case WM_ACTIVATEAPP:
bActive = (BOOL)wParam;
break;
case WM_DESTROY:
Cleanup(); //清除对象
PostQuitMessage(0); //退出消息循环
return 0;
}
return DefWindowProc(hwnd,uMsg,wParam,lParam); //返回默认消息
}
//Direct3D初始化
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance)
{
IDirect3D9 *pD3D=NULL; //定义对象接口
pD3D=Direct3DCreate9(D3D_SDK_VERSION); //创建对象接口
if (NULL==pD3D)
{
return E_FAIL;
}
D3DCAPS9 caps; //获取硬件设备信息
int vp=0;
pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
if (caps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT)
{
vp=D3DCREATE_HARDWARE_VERTEXPROCESSING;
}
else
{
vp=D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
//创建Direct3D设备接口
D3DPRESENT_PARAMETERS d3dpp;
d3dpp.AutoDepthStencilFormat=D3DFMT_D24S8;
d3dpp.BackBufferCount=1;
d3dpp.BackBufferFormat=D3DFMT_A8R8G8B8;
d3dpp.BackBufferHeight=640;
d3dpp.BackBufferWidth=480;
d3dpp.EnableAutoDepthStencil=FALSE;
d3dpp.Flags=0;
d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_DEFAULT;
d3dpp.hDeviceWindow=hwnd;
d3dpp.MultiSampleQuality=0;
d3dpp.MultiSampleType=D3DMULTISAMPLE_NONE;
d3dpp.PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;
d3dpp.Windowed=TRUE;
if (FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hwnd,D3DCREATE_HARDWARE_VERTEXPROCESSING,&d3dpp,&g_pd3dDevice)))
{
return E_FAIL;
}
D3DXCreateTeapot(g_pd3dDevice,&g_pMeshTeapot,0); //创建茶壶集合体
//创建DirectInput设备
DirectInput8Create(hinstance,0x0800,IID_IDirectInput8,(void **)&g_pDirectInput,NULL);
//创建键盘设备
g_pDirectInput->CreateDevice(GUID_SysMouse,&g_pMouseDevice,NULL);
//设置数据格式和协作级别
g_pMouseDevice->SetDataFormat(&c_dfDIMouse);
g_pMouseDevice->SetCooperativeLevel(hwnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
//获取设备
g_pMouseDevice->Acquire();
////世界变换矩阵
//D3DXMATRIX matWorld,Rx,Ry,Rz;
//D3DXMatrixIdentity(&matWorld);
//D3DXMatrixRotationX(&Rx,/*::timeGetTime()/1000*/1.0f);
//D3DXMatrixRotationY(&Ry,/*::timeGetTime()/1000*//*1.0f*/::timeGetTime()/1000.0f);
//D3DXMatrixRotationZ(&Rz,/*::timeGetTime()/1000.0f*//*::timeGetTime()/1000*/1.0f);
//matWorld=Rx*Ry*Rz*matWorld;
//g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//取景变换矩阵
D3DXMATRIX matView;
D3DXVECTOR3 vEye(0.0f,0.0f,-10.0f);
D3DXVECTOR3 vAt(0.0f,0.0f,0.0f);
D3DXVECTOR3 vUp(0.0f,1.0f,0.0f);
D3DXMatrixLookAtLH(&matView,&vEye,&vAt,&vUp);
g_pd3dDevice->SetTransform(D3DTS_VIEW,&matView);
//投影变换矩阵
D3DXMATRIX matProj;
D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4.0f,1.0f,1.0f,1000.0f);
g_pd3dDevice->SetTransform(D3DTS_PROJECTION,&matProj);
pD3D->Release();
return S_OK;
}
//渲染图形
VOID Render()
{
g_pd3dDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(150,150,255),1.0f,0); //清除后台缓冲区
g_pd3dDevice->BeginScene(); //开始绘制
::ZeroMemory(&g_diMousestate,sizeof(g_pMouseDevice));
ReadDevice(g_pMouseDevice,(LPVOID)&g_diMousestate,sizeof(g_diMousestate));
////鼠标左键平移物体
static FLOAT fPosX=0.0f,fPosY=0.0f,fPosZ=0.0f;
if (g_diMousestate.rgbButtons[0]&0x80)
{
fPosX+=g_diMousestate.lX*0.01f; //沿X轴平移
fPosY+=g_diMousestate.lY*-0.01f; //沿Y轴平移
}
fPosZ+=g_diMousestate.lZ*0.005f;
D3DXMATRIX matWorld;
D3DXMatrixTranslation(&matWorld,fPosX,fPosY,fPosZ);
//鼠标右键旋转物体
static float fAngleX=0.0f,fAngleY=0.0f;
if (g_diMousestate.rgbButtons[1]&0x80)
{
fAngleX+=g_diMousestate.lX*-0.01f;
fAngleY+=g_diMousestate.lY*-0.01f;
}
D3DXMATRIX Rx,Ry;
D3DXMatrixRotationX(&Rx,fAngleX);
D3DXMatrixRotationY(&Ry,fAngleY);
matWorld=Rx*Ry*matWorld;
g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//绘制茶壶
g_pMeshTeapot->DrawSubset(0);
g_pd3dDevice->EndScene(); //结束绘制
g_pd3dDevice->Present(NULL,NULL,NULL,NULL); //从后台缓冲区复制到前台----翻转
}
//清除对象,内存
VOID Cleanup()
{
g_pMouseDevice->Unacquire();
ReleaseD3D(g_pMeshTeapot);
ReleaseD3D(g_pMouseDevice);
ReleaseD3D(g_pDirectInput);
ReleaseD3D(g_pd3dDevice);
//if (g_pMeshTeapot!=NULL)
//{
// g_pMeshTeapot->Release();
// g_pMeshTeapot=NULL;
//}
//if (g_pKeyboardDevice!=NULL)
//{
// g_pKeyboardDevice->Release();
// g_pKeyboardDevice=NULL;
//}
//if (g_pDirectInput!=NULL)
//{
// g_pDirectInput->Release();
// g_pDirectInput=NULL;
//}
//if (g_pd3dDevice!=NULL)
//{
// g_pd3dDevice->Release();
// g_pd3dDevice=NULL;
//}
}
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize)
{
HRESULT hr;
while(true)
{
/*pDIDevice->Poll();*/
pDIDevice->Acquire();
if (SUCCEEDED(hr=pDIDevice->GetDeviceState(ISize,pBuffer))) break;
if (hr!=DIERR_INPUTLOST||hr!=DIERR_NOTACQUIRED) return FALSE;
/*if (FAILED(pDIDevice->Acquire())) return FALSE */;
}
return TRUE;
}
代码实例2:
// @time: 2012.3.26
// @author: jadeshu
// des: DirectX鼠标控制程序
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <atlstr.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#define ReleaseD3D(x) if (x!=NULL){x->Release();x=NULL;}
#pragma comment(lib,"winmm.lib")
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dinput8.lib")
#pragma comment(lib, "dxguid.lib")
//全局变量
TCHAR g_szWindowName[]=_T("DirectX鼠标控制程序");
BOOL bActive = TRUE;
DIMOUSESTATE g_diMousestate={0};
//定义设备接口
IDirect3DDevice9 * g_pd3dDevice=NULL;
LPDIRECTINPUT8 g_pDirectInput=NULL; //DirectInput接口
LPDIRECTINPUTDEVICE8 g_pMouseDevice=NULL; //键盘输入接口
LPD3DXMESH g_pMeshTeapot=NULL; //茶壶网格对象
//回调函数声明
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
//初始化Direct3D函数声明
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance);
//渲染声明
VOID Render();
//清除对象声明
VOID Cleanup();
//读取设备的输入数据
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize);
//主函数
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
//定义窗口类结构
TCHAR szAppName[]=TEXT("ClassN");
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
ZeroMemory(&msg,sizeof(msg));
wc.cbClsExtra=0;
wc.cbSize=sizeof(WNDCLASSEX);
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hCursor=LoadCursor(hInstance,IDC_ARROW);
wc.hIcon=LoadIcon(hInstance,IDI_APPLICATION);
wc.hIconSm=NULL;
wc.hInstance=hInstance;
wc.lpfnWndProc=WinProc;
wc.lpszClassName=szAppName;
wc.lpszMenuName=NULL;
wc.style=CS_HREDRAW|CS_VREDRAW;
//注册窗口
RegisterClassEx(&wc);
//创建窗口
hwnd=CreateWindow(szAppName,g_szWindowName,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,0);
//加载3D初始化
if (FAILED(Init3D(hwnd,hInstance)))
{
return FALSE;
}
//显示和更新窗口
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
//消息循环
while (WM_QUIT!=msg.message)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
//转换消息
TranslateMessage(&msg);
//投递消息
DispatchMessage(&msg);
}
else if(bActive)
{
//渲染
Render();
}
else
{
if(!WaitMessage())
return -1;
}
}
//删除注册窗口
UnregisterClass(szAppName,hInstance);
return msg.wParam;
}
//回调函数
LRESULT CALLBACK WinProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch (uMsg)
{
case WM_PAINT:
Render(); //渲染
ValidateRect(hwnd,NULL); //更新窗口
return 0;
case WM_ACTIVATEAPP:
bActive = (BOOL)wParam;
break;
case WM_DESTROY:
Cleanup(); //清除对象
PostQuitMessage(0); //退出消息循环
return 0;
}
return DefWindowProc(hwnd,uMsg,wParam,lParam); //返回默认消息
}
//Direct3D初始化
HRESULT Init3D(HWND hwnd,HINSTANCE hinstance)
{
IDirect3D9 *pD3D=NULL; //定义对象接口
pD3D=Direct3DCreate9(D3D_SDK_VERSION); //创建对象接口
if (NULL==pD3D)
{
return E_FAIL;
}
D3DCAPS9 caps; //获取硬件设备信息
int vp=0;
pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);
if (caps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT)
{
vp=D3DCREATE_HARDWARE_VERTEXPROCESSING;
}
else
{
vp=D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
//创建Direct3D设备接口
D3DPRESENT_PARAMETERS d3dpp;
d3dpp.AutoDepthStencilFormat=D3DFMT_D24S8;
d3dpp.BackBufferCount=1;
d3dpp.BackBufferFormat=D3DFMT_A8R8G8B8;
d3dpp.BackBufferHeight=640;
d3dpp.BackBufferWidth=480;
d3dpp.EnableAutoDepthStencil=FALSE;
d3dpp.Flags=0;
d3dpp.FullScreen_RefreshRateInHz=D3DPRESENT_RATE_DEFAULT;
d3dpp.hDeviceWindow=hwnd;
d3dpp.MultiSampleQuality=0;
d3dpp.MultiSampleType=D3DMULTISAMPLE_NONE;
d3dpp.PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;
d3dpp.Windowed=TRUE;
if (FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hwnd,D3DCREATE_HARDWARE_VERTEXPROCESSING,&d3dpp,&g_pd3dDevice)))
{
return E_FAIL;
}
D3DXCreateTeapot(g_pd3dDevice,&g_pMeshTeapot,0); //创建茶壶集合体
//创建DirectInput设备
DirectInput8Create(hinstance,0x0800,IID_IDirectInput8,(void **)&g_pDirectInput,NULL);
//创建键盘设备
g_pDirectInput->CreateDevice(GUID_SysMouse,&g_pMouseDevice,NULL);
//设置数据格式和协作级别
g_pMouseDevice->SetDataFormat(&c_dfDIMouse);
g_pMouseDevice->SetCooperativeLevel(hwnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
//获取设备
g_pMouseDevice->Acquire();
////世界变换矩阵
//D3DXMATRIX matWorld,Rx,Ry,Rz;
//D3DXMatrixIdentity(&matWorld);
//D3DXMatrixRotationX(&Rx,/*::timeGetTime()/1000*/1.0f);
//D3DXMatrixRotationY(&Ry,/*::timeGetTime()/1000*//*1.0f*/::timeGetTime()/1000.0f);
//D3DXMatrixRotationZ(&Rz,/*::timeGetTime()/1000.0f*//*::timeGetTime()/1000*/1.0f);
//matWorld=Rx*Ry*Rz*matWorld;
//g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//取景变换矩阵
D3DXMATRIX matView;
D3DXVECTOR3 vEye(0.0f,0.0f,-10.0f);
D3DXVECTOR3 vAt(0.0f,0.0f,0.0f);
D3DXVECTOR3 vUp(0.0f,1.0f,0.0f);
D3DXMatrixLookAtLH(&matView,&vEye,&vAt,&vUp);
g_pd3dDevice->SetTransform(D3DTS_VIEW,&matView);
//投影变换矩阵
D3DXMATRIX matProj;
D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4.0f,1.0f,1.0f,1000.0f);
g_pd3dDevice->SetTransform(D3DTS_PROJECTION,&matProj);
pD3D->Release();
return S_OK;
}
//渲染图形
VOID Render()
{
g_pd3dDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(150,150,255),1.0f,0); //清除后台缓冲区
g_pd3dDevice->BeginScene(); //开始绘制
::ZeroMemory(&g_diMousestate,sizeof(g_pMouseDevice));
ReadDevice(g_pMouseDevice,(LPVOID)&g_diMousestate,sizeof(g_diMousestate));
////鼠标左键平移物体
static FLOAT fPosX=0.0f,fPosY=0.0f,fPosZ=0.0f;
if (g_diMousestate.rgbButtons[0]&0x80)
{
fPosX+=g_diMousestate.lX*0.01f; //沿X轴平移
fPosY+=g_diMousestate.lY*-0.01f; //沿Y轴平移
}
fPosZ+=g_diMousestate.lZ*0.005f;
D3DXMATRIX matWorld;
D3DXMatrixTranslation(&matWorld,fPosX,fPosY,fPosZ);
//鼠标右键旋转物体
static float fAngleX=0.0f,fAngleY=0.0f;
if (g_diMousestate.rgbButtons[1]&0x80)
{
fAngleX+=g_diMousestate.lX*-0.01f;
fAngleY+=g_diMousestate.lY*-0.01f;
}
D3DXMATRIX Rx,Ry;
D3DXMatrixRotationX(&Rx,fAngleX);
D3DXMatrixRotationY(&Ry,fAngleY);
matWorld=Rx*Ry*matWorld;
g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);
//绘制茶壶
g_pMeshTeapot->DrawSubset(0);
g_pd3dDevice->EndScene(); //结束绘制
g_pd3dDevice->Present(NULL,NULL,NULL,NULL); //从后台缓冲区复制到前台----翻转
}
//清除对象,内存
VOID Cleanup()
{
g_pMouseDevice->Unacquire();
ReleaseD3D(g_pMeshTeapot);
ReleaseD3D(g_pMouseDevice);
ReleaseD3D(g_pDirectInput);
ReleaseD3D(g_pd3dDevice);
//if (g_pMeshTeapot!=NULL)
//{
// g_pMeshTeapot->Release();
// g_pMeshTeapot=NULL;
//}
//if (g_pKeyboardDevice!=NULL)
//{
// g_pKeyboardDevice->Release();
// g_pKeyboardDevice=NULL;
//}
//if (g_pDirectInput!=NULL)
//{
// g_pDirectInput->Release();
// g_pDirectInput=NULL;
//}
//if (g_pd3dDevice!=NULL)
//{
// g_pd3dDevice->Release();
// g_pd3dDevice=NULL;
//}
}
BOOL ReadDevice(IDirectInputDevice8 *pDIDevice,void *pBuffer,long ISize)
{
HRESULT hr;
while(true)
{
/*pDIDevice->Poll();*/
pDIDevice->Acquire();
if (SUCCEEDED(hr=pDIDevice->GetDeviceState(ISize,pBuffer))) break;
if (hr!=DIERR_INPUTLOST||hr!=DIERR_NOTACQUIRED) return FALSE;
/*if (FAILED(pDIDevice->Acquire())) return FALSE */;
}
return TRUE;
}
DX9 DirectX鼠标控制程序 代码的更多相关文章
- DX9 DirectX键盘控制程序 代码
// @time: 2012.3.26 // @author: jadeshu // des: DirectX键盘控制程序 #include <Windows.h> #include &l ...
- DX9 DirectX 索引缓存(IndexBuffer) 代码
// @time: 2012.3.22 // @author: jadeshu // des: 索引缓存 //包含头文件 #include <Windows.h> #include < ...
- js模拟下拉菜单-键盘、鼠标(代码详解)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- DX9 空间坐标变换示例代码
// @time 2012.3.25 // @author jadeshu #include <Windows.h> #include <d3d9.h> #include &l ...
- 免费CSS鼠标样式代码大全
原文发布时间为:2008-08-01 -- 来源于本人的百度文章 [由搬家工具导入] http://5211.91.tc/sb.htm
- 使用C#+FFmpeg+DirectX+dxva2硬件解码播放h264流
本文门槛较高,因此行文看起来会乱一些,如果你看到某处能会心一笑请马上联系我开始摆龙门阵 如果你跟随这篇文章实现了播放器,那你会得到一个高效率,低cpu占用(单路720p视频解码播放占用1%左右cpu) ...
- 博客代码:iframe—网页中嵌入其他网页
iframe 是一个可以把另外一个网页嵌入到一个网页里的代码,非常有用.对于一个内容不错的网页,要方便地把它搬到自己的博客里,用这个代码最合适.而对于在新浪博客里不支持的一些网页效果和代码,可先把他们 ...
- JS禁止WEB页面鼠标事件大全
<!--禁止鼠标右键代码-->:<noscript><ifra:<scriptlanguage=javas:<!--:if(window.Event):doc ...
- 代码自动生成工具MyGeneration之一(程序员必备工具)
代码自动生成工具MyGeneration之一(程序员必备工具) 转 分类: C#2008-08-06 18:12 16064人阅读 评论(12) 收藏 举报 工具数据库相关数据库stringbrows ...
随机推荐
- STLの应用
QAQ因为绝望地发现好像这些应用都没有题目...所以就专门开了个随笔存题面qwq 谁的孙子最多 给定一棵树,其中1号节点是根节点,问哪一个节点的孙子节点最多,有多少个.(孙子节点,就是儿子节点的儿子节 ...
- 【Python全栈-HTML】HTML入门
HTML入门介绍 参考: https://www.bilibili.com/video/av21663728/?p=339 http://www.cnblogs.com/yuanchenqi/arti ...
- sharepoint webapp 部署注意点
只有在配置文件或 Page 指令中将 enableSessionState 设置为 true 时,才能使用会话状态.还请确保在应用程序配置的 // 节中包括 System.Web.SessionSta ...
- JavaScript的cookie和sessionStorage 、localStorage
localStorage.sessionStorage和cookie的区别与用法请见下面的博客: https://segmentfault.com/a/1190000012057010 cookie的 ...
- InnoDB Next-Key Lock
InnoDB有三种行锁的算法: 1,Record Lock:单个行记录上的锁 2,Gap Lock:间隙锁,锁定一个范围,但不包括记录本身 3,Next-Key Lock:Record Lock + ...
- 003-hive安装
http://www.aboutyun.com/thread-6902-1-1.html http://www.aboutyun.com/thread-7374-1-1.html
- vue中computed和watch的用法
computed用来监控自己定义的变量,该变量不在data里面声明,直接在computed里面定义,然后就可以在页面上进行双向数据绑定展示出结果或者用作其他处理: computed比较适合对多个变量或 ...
- Cartographer源码阅读(2):Node和MapBuilder对象
上文提到特别注意map_builder_bridge_.AddTrajectory(x,x),查看其中的代码.两点: 首先是map_builder_.AddTrajectoryBuilder(...) ...
- PHPstorm破解方法及xdebug的断点调试
原文地址:http://www.php.cn/php-weizijiaocheng-381903.html 相信用PHPstorm的程序员肯定很多,令人头疼的是下载的PHPstorm是有使用期限的,小 ...
- vux 是基于 WeUI 和Vue(2.x)开发的移动端UI组件库,主要服务于微信页面。
https://doc.vux.li/zh-CN/ https://vux.li/