🎉 Присоединяйся к VPN сервису!
💎 При первом пополнении от 100 ₽ ты получишь 25 ₽ бонусом на баланс!
🚀 Быстрое подключение
🌍 Серверы по всему миру
🔒 Надежная защита
Обход белых списков
👇 Переходи по ссылке:
https://t.me/glushvpn_bot?start=refAZIWtKrnкод для создания блюра у окна
void RenderBlur(HWND hwnd) {
struct ACCENTPOLICY {
int na;
int nf;
int nc;
int nA;
};
struct WINCOMPATTRDATA {
int na;
PVOID pd;
ULONG ul;
};
const HINSTANCE hm = LoadLibrary(L"user32.dll");
if (hm) {
typedef BOOL(WINAPI* pSetWindowCompositionAttribute)(HWND, WINCOMPATTRDATA*);
const pSetWindowCompositionAttribute SetWindowCompositionAttribute = (pSetWindowCompositionAttribute)GetProcAddress(hm, "SetWindowCompositionAttribute");
if (SetWindowCompositionAttribute) {
ACCENTPOLICY policy = { 3, 0, 0, 0 };
WINCOMPATTRDATA data = { 19, &policy,sizeof(ACCENTPOLICY) };
SetWindowCompositionAttribute(hwnd, &data);
}
FreeLibrary(hm);
}
}Жестко попускаем Rust - https://youtube.com/live/g3gJ4ZpLihI?feature=share
YouTube
Пишем свой движок на С++ // C++ DEV || Линукс для лохов || Rust параша , С++ жизнь наша
#cpp #dev #gamedev #gameengine #coding
---------------------------------------------------------
Донат: https://donationalerts.com/r/hcpp
Донат2: https://donatepay.ru/don/1128636
За от 5000 р вылезут сиськи / For 64$ boobs will come out
-----------------…
---------------------------------------------------------
Донат: https://donationalerts.com/r/hcpp
Донат2: https://donatepay.ru/don/1128636
За от 5000 р вылезут сиськи / For 64$ boobs will come out
-----------------…
наконец то в движке можно рисовать!!
struct colorU32 {
uint32_t r, g, b, a;
colorU32() : r(0), g(0), b(0), a(0) {}
colorU32(uint32_t _r, uint32_t _g, uint32_t _b, uint32_t _a) : r(_r), g(_g), b(_b), a(_a) {}
uint32_t get() const {
return (((uint32_t)(this->a) << 24) | ((uint32_t)(this->b) << 16) | ((uint32_t)(this->g) << 8) | ((uint32_t)(this->r) << 0));
}
};
struct GLM {
std::vector<uint32_t>pixel_buffer;
GLuint textureID;
int width_texture = 0,height_texture = 0;
void InitTexture() {
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width_texture, height_texture, 0,
GL_RGBA, GL_UNSIGNED_BYTE, pixel_buffer.data());
}
void SetSize(int w, int h) {
width_texture = w;
height_texture = h;
pixel_buffer.resize(w * h);
std::fill(pixel_buffer.begin(), pixel_buffer.end(), 255);
}
void SetPixel(int x, int y, uint32_t color) {
if (x >= 0 && x < width_texture && y >= 0 && y < height_texture) {
pixel_buffer[y * width_texture + x] = color;
}
}
void UpdateTexture() {
if (textureID == 0) return;
glBindTexture(GL_TEXTURE_2D, textureID);
glTexSubImage2D(
GL_TEXTURE_2D,
0,
0, 0,
width_texture, height_texture,
GL_RGBA, GL_UNSIGNED_BYTE,
pixel_buffer.data()
);
glBindTexture(GL_TEXTURE_2D, 0);
}
void fillSqware(int size_x, int size_y, bool isEnableMultiThreads = false) {
if (!isEnableMultiThreads) {
for (int x = 0; x < size_x; x++) {
for (int y = 0; y < size_y; y++) {
SetPixel(x, y, colorU32(rand() % 255, rand() % 255, rand() % 255, rand() % 255).get());
}
}
}
else {
uint32_t num_threads = std::jthread::hardware_concurrency();
size_t total_pixels = (size_t)size_x * size_y;
size_t chunk_size = total_pixels / num_threads;
std::vector<std::jthread> tCPUThreads;
for (uint32_t t = 0; t < num_threads; ++t) {
size_t start_index = t * chunk_size;
size_t end_index = (t == num_threads - 1) ? total_pixels : (t + 1) * chunk_size;
tCPUThreads.emplace_back([=] {
for (size_t i = start_index; i < end_index; ++i) {
uint32_t random_rgba = colorU32(rand() % 255,rand() % 255, rand() % 255,255).get();
int x = i % size_x;
int y = i / size_x;
this->pixel_buffer[i] = random_rgba;
}
});
}
}
}
void Pen(int draw_x,int draw_y, colorU32 u32Color) {
int brush_size = 20;
int half_brush = brush_size / 2;
for (int x = draw_x - half_brush; x < draw_x + half_brush; x++) {
for (int y = draw_y - half_brush; y < draw_y + half_brush; y++) {
if (x >= 0 && x < width_texture &&
y >= 0 && y < height_texture)
{
SetPixel(x, y, u32Color.get());
}
}
}
}
};👍1