-
Автор темы
- #1
add wherever you want
Plz yous your brain and understand this code benefits compared to byte if u just want to use a background image like skeet use byte if u wanna do paid level crap like per user image etc use this
add in your present /endscene hook
add in your menu
u can also use
Plz yous your brain and understand this code benefits compared to byte if u just want to use a background image like skeet use byte if u wanna do paid level crap like per user image etc use this
C++:
PDIRECT3DTEXTURE9 my_texture = NULL;
#include <D3dx9tex.h>
#pragma comment(lib, "D3dx9")
// Simple helper function to load an image into a DX9 texture with common settings
bool LoadTextureFromFile(const char* filename, PDIRECT3DTEXTURE9* out_texture, int* out_width, int* out_height)
{
// Load texture from disk
PDIRECT3DTEXTURE9 texture;
HRESULT hr = D3DXCreateTextureFromFileA(g_pd3dDevice, filename, &texture);
if (hr != S_OK)
return false;
// Retrieve description of the texture surface so we can access its size
D3DSURFACE_DESC my_image_desc;
texture->GetLevelDesc(0, &my_image_desc);
*out_texture = texture;
*out_width = (int)my_image_desc.Width;
*out_height = (int)my_image_desc.Height;
return true;
}
C++:
int my_image_width = 0;
int my_image_height = 0;
bool ret = LoadTextureFromFile("you file location / filename.jpg", &my_texture, &my_image_width, &my_image_height);
IM_ASSERT(ret);
C++:
ImGui::Image((void*)my_texture, ImVec2(my_image_width, my_image_height));
C++:
window->DrawList->AddImage(void*)my_texture, ImVec2(window->Pos + ImVec2(70, 70)), ImVec2(window->Pos.x + window->Size.x, window->Pos.y + window->Size.y), ImVec2(0, 0), ImVec2(1, 1), ImColor(1.f, 1.f, 1.f));
Последнее редактирование: