冰楓論壇
標題:
CSO Opengl 大部分的功能寫法
[打印本頁]
作者:
死神007
時間:
2018-5-11 16:43
標題:
CSO Opengl 大部分的功能寫法
可能對大部分的人有用的功能吧 近期有人找我要源碼 如果是技術交流 我很樂意分享 但是妳壹直讓我發源碼 我只是發原理和寫法 如果妳只是想直接編譯 那是不可能的
准星的几种写法
Hook glViewport
//获取准星坐标
void WINAPI HookOpengl::extglViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
glWidth = width;
glHeight = height;
glViewport(x, y, width, height);
}
//画出准星 Hook glColor3f
void WINAPI HookOpengl::extglColor3f(GLfloat red, GLfloat green, GLfloat blue)
{
if (g_Vars.WallHack.SightBead == 2 && g_Vars.WallHack.Enable)
{
glCrosshair();
}
glColor3f(red, green, blue);
}
void WINAPI glCrosshair()
{
float params[4];
glEnable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glGetFloatv(GL_CURRENT_COLOR, params);
glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_POLYGON);
for (int i = 10; i != 0; i--)
{
glVertex2f(cos(0.6283185307179586f*i)*3.0f + (glWidth / 2), sin(0.6283185307179586f*i)*3.0f + (glHeight / 2));
}
glEnd();
glDisable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
glColor3f(params[0], params[1], params[2]);
}
第二种准星写法 Hook glEnable
void WINAPI HookOpengl::extglEnable(GLenum cap)
{
if (g_Vars.WallHack.SightBead == 1 && g_Vars.WallHack.Enable && !Functions::Visuals::g_Menu.Visible)
{
GLfloat color[4];
GLint iDim[4];
glGetFloatv(GL_CURRENT_COLOR, color);
glPushMatrix();
glLoadIdentity();
glDisable(GL_TEXTURE_2D);
glGetIntegerv(GL_VIEWPORT, iDim);
glColor4f(1.0f, 1.0f, 0.0f, 0.7f);
glLineWidth(1.5f);
glBegin(GL_LINES);
glVertex2i(iDim[2] / 2, (iDim[3] / 2) - 12);
glVertex2i(iDim[2] / 2, (iDim[3] / 2) - 5);
glVertex2i(iDim[2] / 2, (iDim[3] / 2) + 5);
glVertex2i(iDim[2] / 2, (iDim[3] / 2) + 12);
glVertex2i((iDim[2] / 2) - 12, iDim[3] / 2);
glVertex2i((iDim[2] / 2) - 5, iDim[3] / 2);
glVertex2i((iDim[2] / 2) + 5, iDim[3] / 2);
glVertex2i((iDim[2] / 2) + 12, iDim[3] / 2);
glEnd();
glColor3f(color[0], color[1], color[2]);
glBegin(GL_POINTS);
glVertex2i((iDim[2] / 2) - 3, iDim[3] / 2);
glVertex2i((iDim[2] / 2) + 3, iDim[3] / 2);
glVertex2i(iDim[2] / 2, (iDim[3] / 2) - 3);
glVertex2i(iDim[2] / 2, (iDim[3] / 2) + 3);
glEnd();
glEnable(GL_TEXTURE_2D);
glPopMatrix();
}
glEnable(cap);
}
其他的
2018-5-11 16:40 上傳
下載附件
(55.15 KB)
2018-5-11 16:40 上傳
下載附件
(47.15 KB)
另外我在國外發現還有另外繪圖的方法 遊戲的接口 有意思的可以起研究
2018-5-11 16:42 上傳
下載附件
(64.49 KB)
作者:
Pos
時間:
2018-5-11 17:36
讚一個 留名
作者:
幻想
時間:
2018-5-11 18:22
易语言的返回值检测表示头痛 看来还是必须用C++来写在调用会比较好
作者:
qaz9487
時間:
2018-5-11 21:38
Pos雜種狗 偷我源碼
作者:
asdasd6892075
時間:
2023-5-4 20:49
你好老哥,有没有相关opengl hook视频教程,或者youtube关键词?,目前还没找到,不知道是不是需要搜索🔍哪些关键词。
歡迎光臨 冰楓論壇 (https://bingfong.com/)
Powered by 冰楓