Skip to content

Instantly share code, notes, and snippets.

View ZOulhadj's full-sized avatar
🌍
Focusing

Zakariya Oulhadj ZOulhadj

🌍
Focusing
View GitHub Profile
@ZOulhadj
ZOulhadj / main.c
Created July 9, 2024 21:48
Rectangle copy
static void copy_rect(char* buffer_src, int pitch_a,
char* buffer_dst, int pitch_b,
int from_min_x, int from_min_y,
int from_max_x, int from_max_y,
int to_min_x, int to_min_y)
{
char* src = buffer_src + from_min_y * pitch_a + from_min_x;
char* dst = buffer_dst + to_min_y * pitch_b + to_min_x;
int width = from_max_x - from_min_x;
class Camera {
private:
glm::vec3 mPosition;
glm::quat mOrientation;
public:
void pitch(float pitchRadians) {
rotate(pitchRadians, glm::vec3(1.0f, 0.0f, 0.0f));
}