This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| bitlib.h | |
| This library simulates the four arithmetic functions: ( addition, subtraction, multiplication, and division ) | |
| Using only bitwise operations: ( AND, OR, XOR, SHL, SHR ) | |
| Most of the time I would not need to do this, however, there exist applications where this information may prove useful. | |
| - Programming ARM CPUs which don't have a division instruction. | |
| - Arbitary Precision Arithmetic involving thousands of digits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <SDL.h> | |
| int width=1280,height=720; | |
| int loop=1; | |
| SDL_Window *window; | |
| SDL_Surface *surface; | |
| SDL_Event e; | |
| int main(int argc, char **argv) | |
| { | |
| window=SDL_CreateWindow("SDL Program",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,width,height,SDL_WINDOW_SHOWN ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define GLEW_STATIC | |
| #include <GL/glew.h> | |
| #include <SDL.h> | |
| #include <SDL_opengl.h> | |
| SDL_Window* window; | |
| SDL_GLContext context; | |
| SDL_Event event; | |
| GLuint vertexBuffer; | |
| int loop=1; |