NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <Windows.h>
#include <GLglew.h>
#include <GLfreeglut.h> //diger iki dosyanin icerigini barindirir
#include<iostream>
#include <stdio.h>
#include <stdlib.h>

#include <fstream>
#include<string>
#include<sstream>
#include <math.h>

GLfloat red = 0.0, blue = 0.0, green = 0.0;

using namespace std;

#define KIRMIZI 1
#define YESIL 2
#define MAVI 3
#define PEMBE 4

GLubyte letters[][13] = {
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18 },//draw A
{ 0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw B
{ 0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e },//draw C
{ 0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc },//draw D
{ 0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff },//draw E
{ 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff },//draw F
{ 0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e },//draw G
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 },//draw H
{ 0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e },//draw I
{ 0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 },//draw J
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3 },//draw K
{ 0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 },//draw L
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3 },//draw M
{ 0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3 },//draw N
{ 0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e },//draw O
{ 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw P
{ 0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c },//draw Q
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw R
{ 0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e },//draw S
{ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff },//draw T
{ 0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 },//draw U
{ 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 },//draw V
{ 0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 },//draw W
{ 0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3 },//draw X
{ 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3 },//draw Y
{ 0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff } //draw Z
};

GLubyte adSoyad[][13] = {
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18 },//draw A
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw R
{ 0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff },//draw Z
{ 0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 },//draw U
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3 },//draw M

{ 0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw B
{ 0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff },//draw E
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw R
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw R
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18 },//draw A
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3 },//draw K

{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18 },//draw A
{ 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw R
{ 0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e },//draw I
{ 0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe },//draw B
{ 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18 },//draw A
{ 0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 },//draw L
};

GLubyte numbers[][7] = { { 0x06, 0x00, 0x7E, 0x81, 0x81, 0x81, 0x7E }, // Code for char 0
{ 0x06, 0x00, 0x82, 0x82, 0xFF, 0x80, 0x80 }, // Code for char 1
{ 0x06, 0x00, 0xC2, 0xA1, 0x91, 0x89, 0x86 }, // Code for char 2
{ 0x06, 0x00, 0x42, 0x81, 0x89, 0x89, 0x76 }, // Code for char 3
{ 0x06, 0x30, 0x28, 0x24, 0x22, 0xFF, 0x20 }, // Code for char 4
{ 0x06, 0x00, 0x4F, 0x89, 0x89, 0x89, 0x71 }, // Code for char 5
{ 0x06, 0x00, 0x7C, 0x8A, 0x89, 0x89, 0x70 }, // Code for char 6
{ 0x06, 0x00, 0x01, 0xC1, 0x31, 0x0D, 0x03 }, // Code for char 7
{ 0x06, 0x00, 0x76, 0x89, 0x89, 0x89, 0x76 }, // Code for char 8
{ 0x06, 0x00, 0x0E, 0x91, 0x91, 0x51, 0x3E } // Code for char 9
};

GLubyte numara[] = { '2','1','3','9','3','1','5','0' };


void Cizgiler() {
GLfloat BaskentLogoKoordinatlar[4][8][2]
= {
{ { 0.0,280.0 },{ 138.907,145.885 },{ 98.5551,105.542 },{ 39.9941,164.0 },{ 0.0,0.0 },{ -39.9938,160.0 },{ -97.4877,108.5 },{ -136.482,147.5 } },
{ { 280.0,0.0 },{ 145.885,-138.907 },{ 105.542,-98.5551 },{ 164,-39.9941 },{ 0.0,0.0 },{ 160.0,39.9937 },{ 108.5,97.4877 },{ 147.5,136.482 } },
{ { 0.0,-280.0 },{ -138.907,-145.885 },{ -98.5551,-105.542 },{ -39.9941,-164.0 },{ 0.0,0.0 },{ 39.9937, -160.0 },{ 97.4876, -108.5 },{ 136.482, -147.5 } },
{ { -280.0,0.0 },{ -145.885,138.907 },{ -105.541,98.5551 },{ -164,39.9941 },{ 0.0,0.0 },{ -160.0,-39.9937 },{ -108.5,-97.4876 },{ -147.5,-136.482 } }
};
glColor3f(red, green, blue);
for (int j = 0; j < 4; j++)
{
glBegin(GL_POLYGON);
for (int i = 0; i<8; i++)
{
int a = i + (j * 8);
glVertex2fv(BaskentLogoKoordinatlar[j][i]);

}
glEnd();//Cizgi cizdirme komut blogu bitti
}
glFlush();//Bufferı bosaltir
}

void init() {

glMatrixMode(GL_PROJECTION);

glLoadIdentity(); //reset islemi

gluOrtho2D(-400, 400, -400, 400);

glColor3f(0.0, 0.0, 0.0); //siyah renkli cizim

//glLineWidth(3); //Cizgi kalinligi
}


void Renkler(int option) {
switch (option)
{
case KIRMIZI:
red = 1.0;
green = 0.0;
blue = 0.0;
break;

case YESIL:
red = 0.0;
green = 1.0;
blue = 0.0;
break;

case MAVI:
red = 0.0;
green = 0.0;
blue = 1.0;
break;

case PEMBE:
red = 1.0;
green = 0.0;
blue = 1.0;
break;

default:
break;
}
Cizgiler();
}

void createGLUTMenus()
{
glutCreateMenu(Renkler);
//menuye menu elemanlarını ekledim
glutAddMenuEntry("KIRMIZI BOYA", KIRMIZI);
glutAddMenuEntry("MAVI BOYA", MAVI);
glutAddMenuEntry("YESIL BOYA", YESIL);
glutAddMenuEntry("PEMBE BOYA", PEMBE);
glutAttachMenu(GLUT_RIGHT_BUTTON); //Yaratılan menu sag fare tusuna atadık
}

void klavye(unsigned char ch, int x, int y)
{
switch (ch)
{
case 'A':
case 'a':
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

for (int i = 0; i < 17; i++)
{
glColor3f(0.0, 0.0, 0.0);
glRasterPos2i(140 + (i*15), -300);
glBitmap(8, 13, 0.0, 0.0, 10.0, 10.0, adSoyad[i]);
}

for (int i = 0; i < 8; i++)
{
glColor3f(0.0, 0.0, 0.0);
glRasterPos2i(140 + (i*15), -310);
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, numara[i]);
}
glFlush();
break;
case 'Z' :
case 'z':
glClearColor(1.0, 1.0, 1.0, 1.0); //pencere icini beyaz ile doldur
glClear(GL_COLOR_BUFFER_BIT); //pencere icini temizlerken beyaz ile temizler
Cizgiler();
break;
default:
break;
}
}


int main(int argc, char **argv)
{
glutInit(&argc, argv); // mainden gelen parametreler ile initilization

glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA); //goruntuleme secenekleri

glutInitWindowPosition(10, 10);//cizim penceresinin sol ustten mesafesi

glutInitWindowSize(800, 800); //cizim penceresinin ekran boyutu

glutCreateWindow("BASKENT UNIVERSITESI LOGOSU - 2017 / ANKARA"); //pencere olusturma ve isim verme

init(); //Initialization icin

glClearColor(1.0, 1.0, 1.0, 1.0); //pencere icini beyaz ile doldur

glClear(GL_COLOR_BUFFER_BIT); //pencere icini temizlerken beyaz ile temizler

glutDisplayFunc(Cizgiler); //Yapilacak fonksiyon cagiriliyor
createGLUTMenus();
glutKeyboardFunc(klavye);
glutMainLoop(); //her seyi ekranda göster ve bekle

return 0;
}


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.