Skip to content

Instantly share code, notes, and snippets.

Wellington Domiciano wldomiciano

Block or report user

Report or block wldomiciano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View vector.c
// compiles with
// gcc vector.c -Wall -Wextra -Wpedantic `sdl2-config --cflags --libs` -lm
#include <SDL.h>
#include <math.h>
const double PI = 3.14159265358979323846264338327950288;
typedef struct {
double x, y;
@wldomiciano
wldomiciano / circle-drawing.c
Created May 23, 2019
Drawing a normal and filled circle with SDL 2
View circle-drawing.c
#include <SDL.h>
SDL_Window* window;
SDL_Renderer* renderer;
void drawCircle(int xc, int yc, int x, int y) {
SDL_RenderDrawPoint(renderer, xc + x, yc + y);
SDL_RenderDrawPoint(renderer, xc - x, yc + y);
SDL_RenderDrawPoint(renderer, xc + x, yc - y);
@wldomiciano
wldomiciano / remove-pinned-app-from-start-menu.ps1
Last active Nov 25, 2018
Remove all pinned apps from start menu in Windows 10
View remove-pinned-app-from-start-menu.ps1
(New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() |
%{ $_.Verbs() } | ?{ $_.Name -match 'Un.*pin from Start' } | %{ $_.DoIt() }
@wldomiciano
wldomiciano / sdl2-tff-exemplo-com-renderer.c
Created Sep 12, 2018
Exemplo usando SDL 2 com SDL_ttf usando renderer
View sdl2-tff-exemplo-com-renderer.c
// Testado com MinGW64:
// gcc -Wall -Wextra -Wpedantic -Wno-unused-parameter test1.c `sdl2-config --cflags --libs` -lSDL2_ttf
#include <SDL.h>
#include <SDL_ttf.h>
SDL_Window *window;
SDL_Renderer *renderer;
TTF_Font *font;
#define MAX_LENGTH 1024
@wldomiciano
wldomiciano / sdl2-ttf-basico.c
Last active Sep 12, 2018
Exemplo básico usando SDL 2 com SDL_ttf
View sdl2-ttf-basico.c
// Testado com MinGW64:
// gcc -Wall -Wextra -Wpedantic -Wno-unused-parameter test0.c `sdl2-config --cflags --libs` -lSDL2_ttf
#include <SDL.h>
#include <SDL_ttf.h>
SDL_Window *window;
SDL_Surface *surface;
TTF_Font *font;
int main(int argc, char *argv[]) {
@wldomiciano
wldomiciano / sdl2-ttf-exemplo-com-window-surface.c
Last active Sep 12, 2018
Exemplo usando SDL 2 com SDL_ttf usando window surface
View sdl2-ttf-exemplo-com-window-surface.c
// Testado com MinGW64:
// gcc -Wall -Wextra -Wpedantic -Wno-unused-parameter test1.c `sdl2-config --cflags --libs` -lSDL2_ttf
#include <SDL.h>
#include <SDL_ttf.h>
SDL_Window *window;
SDL_Surface *surface;
TTF_Font *font;
#define MAX_LENGTH 1024
@wldomiciano
wldomiciano / compile.bat
Last active Sep 10, 2018
Comando para compilar um programa usando SDL 2 com o CL, o compilador do MSBuild
View compile.bat
set SDL2=\path\to\sdl
@rem Use %SDL2%\lib\x64 for x64 builds
set SDL2LIB=%SDL2%\lib\x86
@rem Put on PATH the DLLs
set PATH=%PATH%;%SDL2LIB%
@rem Alternative subsystem: /SUBSYSTEM:WINDOWS
cl yourcode.c /OUT yourprogram /I %SDL2%\include /LINK /LIBPATH:%SDL2LIB% SDL2.lib SDL2main.lib /SUBSYSTEM:CONSOLE
@wldomiciano
wldomiciano / snake.java
Created Apr 22, 2018
A simple Snake clone implementation in Java
View snake.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class Game extends JPanel implements ActionListener {
final int TIMEOUT = 125;
final int SIZE = 25;
final int BOARD_COLS = 10;
final int BOARD_ROWS = 10;
final int BOARD_SIZE = (BOARD_COLS * BOARD_ROWS);
@wldomiciano
wldomiciano / snake.html
Created Apr 22, 2018
A simple Snake clone implementation in JavaScript
View snake.html
<!DOCTYPE html>
<html>
<head>
<title>A simple Snake Clone</title>
</head>
<body>
<canvas id="game" width="250" height="250" style="background: #000"></canvas>
<script>
const TIMEOUT = 125
const SIZE = 25
@wldomiciano
wldomiciano / snake.c
Last active Apr 22, 2018
A simple Snake clone implementation in C with SDL 2
View snake.c
#include <stdlib.h>
#include <stdbool.h>
#include <SDL2/SDL.h>
#define TIMEOUT 150
#define SIZE 25
#define BOARD_COLS 10
#define BOARD_ROWS 10
#define BOARD_SIZE (BOARD_COLS * BOARD_ROWS)
You can’t perform that action at this time.