From de41e4440d84f21ac6618f7fd44d3a0ca94e7305 Mon Sep 17 00:00:00 2001 From: SoloArchx250 Date: Fri, 15 May 2020 15:50:59 -0400 Subject: [PATCH] fix gitignore --- .history/Makefile_20200511140830 | 16 -- .history/Makefile_20200511200301 | 16 -- .history/Makefile_20200511200400 | 17 -- .history/Makefile_20200511201938 | 17 -- .history/Makefile_20200511201953 | 16 -- .history/Makefile_20200511202032 | 16 -- .history/Makefile_20200511202051 | 16 -- .history/Makefile_20200511202102 | 16 -- .history/Makefile_20200511202110 | 16 -- .history/Makefile_20200511202111 | 16 -- .history/Makefile_20200511202113 | 16 -- .history/Makefile_20200511202207 | 16 -- .history/Makefile_20200511202225 | 16 -- .history/Makefile_20200511202244 | 16 -- .history/Makefile_20200511202254 | 16 -- .history/Makefile_20200511222404 | 17 -- .history/Makefile_20200511222408 | 17 -- .history/Makefile_20200511222417 | 17 -- .history/Makefile_20200511222546 | 17 -- .history/Makefile_20200511222552 | 17 -- .history/Makefile_20200511222632 | 17 -- .history/Makefile_20200511223118 | 20 --- .history/Makefile_20200511232417 | 20 --- .history/Makefile_20200511232942 | 21 --- .history/Makefile_20200511232949 | 21 --- .history/Makefile_20200511233258 | 19 --- .history/Makefile_20200511233332 | 20 --- .history/Makefile_20200511233403 | 21 --- .history/Makefile_20200511233423 | 22 --- .history/Makefile_20200511233451 | 23 --- .history/Makefile_20200511233512 | 23 --- .history/Makefile_20200511233531 | 21 --- .history/Makefile_20200511233537 | 21 --- .history/Makefile_20200511233619 | 23 --- .history/Makefile_20200511233631 | 23 --- .history/Makefile_20200511233633 | 23 --- .history/Makefile_20200511233703 | 23 --- .history/Makefile_20200511233707 | 23 --- .history/Makefile_20200511233714 | 23 --- .history/Makefile_20200511233726 | 23 --- .history/Makefile_20200511233826 | 23 --- .history/Makefile_20200511233926 | 23 --- .history/Makefile_20200511233935 | 23 --- .history/Makefile_20200511233946 | 23 --- .history/Makefile_20200511234024 | 23 --- .history/Makefile_20200511234030 | 23 --- .history/Makefile_20200511234130 | 23 --- .history/Makefile_20200511234218 | 23 --- .history/Makefile_20200511234223 | 23 --- .history/Makefile_20200511234429 | 23 --- .history/Makefile_20200511234457 | 23 --- .history/Makefile_20200511234505 | 23 --- .history/Makefile_20200511234522 | 23 --- .history/Makefile_20200511234615 | 23 --- .history/Makefile_20200511234621 | 23 --- .history/Makefile_20200511234639 | 23 --- .history/Makefile_20200511234646 | 23 --- .history/Makefile_20200511235501 | 23 --- .history/Makefile_20200511235522 | 23 --- .history/Makefile_20200511235543 | 23 --- .history/Makefile_20200511235607 | 23 --- .history/Makefile_20200511235632 | 23 --- .history/Makefile_20200511235725 | 23 --- .history/Makefile_20200511235727 | 23 --- .history/Makefile_20200511235737 | 23 --- .history/Makefile_20200511235920 | 23 --- .history/Makefile_20200512000709 | 23 --- .history/Makefile_20200512001624 | 23 --- .history/Makefile_20200512001633 | 23 --- .history/Makefile_20200512001749 | 23 --- .history/Makefile_20200512001840 | 23 --- .history/Makefile_20200512001924 | 23 --- .history/Makefile_20200512001959 | 23 --- .history/Makefile_20200512002002 | 23 --- .history/Makefile_20200512002353 | 23 --- .history/Makefile_20200512002453 | 23 --- .history/Makefile_20200512002502 | 23 --- .history/Makefile_20200512002516 | 23 --- .history/Makefile_20200512002533 | 23 --- .history/Makefile_20200512002632 | 23 --- .history/Makefile_20200512002654 | 23 --- .history/Makefile_20200512002708 | 23 --- .history/Makefile_20200512002742 | 23 --- .history/Makefile_20200512002756 | 23 --- .history/Makefile_20200512003649 | 15 -- .history/Makefile_20200512003657 | 15 -- .history/Makefile_20200512003732 | 15 -- .history/Makefile_20200512003757 | 15 -- .history/Makefile_20200512003818 | 15 -- .history/Makefile_20200512003822 | 15 -- .history/Makefile_20200512003829 | 15 -- .history/Makefile_20200512003842 | 16 -- .history/Makefile_20200512003911 | 16 -- .history/Makefile_20200512003927 | 16 -- .history/Makefile_20200512003938 | 16 -- .history/Makefile_20200512004016 | 15 -- .history/Makefile_20200512004205 | 16 -- .history/Makefile_20200512005117 | 25 --- .history/Makefile_20200512005124 | 25 --- .history/Makefile_20200512005227 | 26 --- .history/Makefile_20200512005507 | 25 --- .history/Makefile_20200512005538 | 25 --- .history/Makefile_20200512005607 | 25 --- .history/Makefile_20200512005648 | 25 --- .history/Makefile_20200512005729 | 30 ---- .history/Makefile_20200512005741 | 30 ---- .history/Makefile_20200512005803 | 30 ---- .history/Makefile_20200512005826 | 30 ---- .history/Makefile_20200512005851 | 28 ---- .history/Makefile_20200512005925 | 29 ---- .history/Makefile_20200512005944 | 29 ---- .history/Makefile_20200512010012 | 29 ---- .history/Makefile_20200512095009 | 29 ---- .history/Makefile_20200512095614 | 29 ---- .history/Makefile_20200512095616 | 29 ---- .history/Makefile_20200512113711 | 33 ---- .history/Makefile_20200512122020 | 34 ---- .history/Makefile_20200512122058 | 34 ---- .history/Makefile_20200512122134 | 34 ---- .history/Makefile_20200512122202 | 33 ---- .history/Makefile_20200512122220 | 33 ---- .history/Makefile_20200512122241 | 33 ---- .history/Makefile_20200512122259 | 33 ---- .history/Makefile_20200512122307 | 33 ---- .history/Makefile_20200512122440 | 33 ---- .history/Makefile_20200512122803 | 34 ---- .history/Makefile_20200512122821 | 34 ---- .history/Makefile_20200512122910 | 33 ---- .history/Makefile_20200512145408 | 34 ---- .history/Makefile_20200512145509 | 36 ---- .history/Makefile_20200512145543 | 36 ---- .history/Makefile_20200512145729 | 33 ---- .history/Makefile_20200512145745 | 33 ---- .history/Makefile_20200513122930 | 37 ----- .history/Makefile_20200513122959 | 37 ----- .history/Makefile_20200513123017 | 38 ----- .history/Makefile_20200513123140 | 38 ----- .history/Makefile_20200513123200 | 38 ----- .history/Makefile_20200513123243 | 38 ----- .history/Makefile_20200513123410 | 38 ----- .history/Makefile_20200513123423 | 38 ----- .history/Makefile_20200513123433 | 38 ----- .history/Makefile_20200513123441 | 38 ----- .history/Makefile_20200513123514 | 39 ----- .history/Makefile_20200513123603 | 39 ----- .history/Makefile_20200513123629 | 39 ----- .history/Makefile_20200513123759 | 39 ----- .history/Makefile_20200513123840 | 39 ----- .history/Makefile_20200513123854 | 39 ----- .history/Makefile_20200513123905 | 39 ----- .history/Makefile_20200513124216 | 39 ----- .history/Makefile_20200513124320 | 39 ----- .history/Makefile_20200513124438 | 40 ----- .history/Makefile_20200513124541 | 39 ----- .history/Makefile_20200513124558 | 39 ----- .history/Makefile_20200513124608 | 39 ----- .history/Makefile_20200513124624 | 39 ----- .history/Makefile_20200513125013 | 40 ----- .history/Makefile_20200513125052 | 40 ----- .history/Makefile_20200513125126 | 40 ----- .history/Makefile_20200513125143 | 40 ----- .history/Makefile_20200513125206 | 40 ----- .history/Makefile_20200513125218 | 39 ----- .history/Makefile_20200513125946 | 40 ----- .history/Makefile_20200513130104 | 42 ----- .history/Makefile_20200513130117 | 42 ----- .history/Makefile_20200513130353 | 42 ----- .history/Makefile_20200513130432 | 39 ----- .history/Makefile_20200513130456 | 40 ----- .history/Makefile_20200513130508 | 40 ----- .history/Makefile_20200513130809 | 40 ----- .history/Makefile_20200513130839 | 40 ----- .history/Makefile_20200513130844 | 39 ----- .history/Makefile_20200513130854 | 40 ----- .history/Makefile_20200513130906 | 39 ----- .history/Makefile_20200513130915 | 40 ----- .history/Makefile_20200513130933 | 41 ----- .history/Makefile_20200513131004 | 42 ----- .history/Makefile_20200513131017 | 42 ----- .history/Makefile_20200513131041 | 40 ----- .history/Makefile_20200513131048 | 40 ----- .history/Makefile_20200513131123 | 40 ----- .history/Makefile_20200513131132 | 40 ----- .history/Makefile_20200513131146 | 40 ----- .history/Makefile_20200513131336 | 40 ----- .history/Makefile_20200513131344 | 40 ----- .history/Makefile_20200513131602 | 42 ----- .history/Makefile_20200513131621 | 42 ----- .history/Makefile_20200513131845 | 42 ----- .history/Makefile_20200513131940 | 42 ----- .history/Makefile_20200513132006 | 42 ----- .history/Makefile_20200513132016 | 42 ----- .history/Makefile_20200513132905 | 39 ----- .history/Makefile_20200513132931 | 40 ----- .history/Makefile_20200513132942 | 40 ----- .history/Makefile_20200513134126 | 40 ----- .history/Makefile_20200513134548 | 1 - .history/Makefile_20200513135257 | 4 - .history/generatecube_20200511164401.lua | 0 .history/generatecube_20200511171029.lua | 2 - .history/src/Color_20200511171542.h | 10 -- .history/src/Color_20200511175158.h | 10 -- .history/src/Color_20200511175840.h | 16 -- .history/src/Color_20200511175845.h | 16 -- .history/src/Color_20200511175902.h | 16 -- .history/src/Color_20200511180426.h | 19 --- .history/src/Color_20200511180509.h | 11 -- .history/src/Color_20200511184059.h | 11 -- .history/src/Color_20200511184834.h | 11 -- .history/src/Color_20200511184840.h | 11 -- .history/src/Color_20200511185132.h | 11 -- .history/src/Color_20200511195616.h | 16 -- .history/src/Color_20200511214107.cpp | 0 .history/src/Color_20200511214344.cpp | 1 - .history/src/Color_20200511214346.cpp | 8 - .history/src/Color_20200511214352.cpp | 8 - .history/src/Color_20200511214540.h | 10 -- .history/src/Color_20200511214543.cpp | 8 - .history/src/Color_20200511214549.cpp | 1 - .history/src/Color_20200511214553.h | 16 -- .history/src/Color_20200511214556.h | 16 -- .history/src/Color_20200511214607.h | 16 -- .history/src/Color_20200511214903.h | 11 -- .history/src/Color_20200511214929.cpp | 8 - .history/src/Color_20200511215000.cpp | 8 - .history/src/Color_20200511215006.cpp | 8 - .history/src/Color_20200511215017.cpp | 9 - .history/src/Color_20200511215019.cpp | 9 - .history/src/Color_20200511215026.cpp | 9 - .history/src/Color_20200511215048.cpp | 9 - .history/src/Color_20200512000019.h | 11 -- .history/src/Color_20200512000031.h | 11 -- .history/src/Color_20200512000048.cpp | 9 - .history/src/Color_20200512011729.h | 13 -- .history/src/Color_20200512011730.h | 13 -- .history/src/Cube_20200511182530.h | 0 .history/src/Cube_20200511182542.h | 1 - .history/src/Cube_20200511183329.h | 6 - .history/src/Cube_20200511183343.h | 8 - .history/src/Cube_20200511183548.h | 8 - .history/src/Cube_20200511184002.h | 26 --- .history/src/Cube_20200511184009.h | 26 --- .history/src/Cube_20200511184116.h | 26 --- .history/src/Cube_20200511184202.h | 27 --- .history/src/Cube_20200511184203.h | 27 --- .history/src/Cube_20200511184209.h | 28 ---- .history/src/Cube_20200511184212.h | 27 --- .history/src/Cube_20200511184523.h | 41 ----- .history/src/Cube_20200511184555.h | 41 ----- .history/src/Cube_20200511184633.h | 45 ----- .history/src/Cube_20200511184644.h | 46 ------ .history/src/Cube_20200511185025.h | 46 ------ .history/src/Cube_20200511200128.h | 46 ------ .history/src/Cube_20200511215053.cpp | 0 .history/src/Cube_20200511215349.cpp | 13 -- .history/src/Cube_20200511215400.cpp | 13 -- .history/src/Cube_20200511215430.cpp | 20 --- .history/src/Cube_20200511215539.cpp | 35 ---- .history/src/Cube_20200511215544.cpp | 35 ---- .history/src/Cube_20200511215553.h | 30 ---- .history/src/Cube_20200511215555.h | 30 ---- .history/src/Cube_20200511215557.h | 30 ---- .history/src/Cube_20200511215604.h | 30 ---- .history/src/Cube_20200511215610.h | 30 ---- .history/src/Cube_20200511215619.h | 26 --- .history/src/Cube_20200511215638.cpp | 40 ----- .history/src/Cube_20200511215641.cpp | 40 ----- .history/src/Cube_20200511215657.h | 26 --- .history/src/Cube_20200511215708.h | 27 --- .history/src/Cube_20200511215722.cpp | 40 ----- .history/src/Cube_20200512000150.h | 27 --- .history/src/Cube_20200512000152.h | 27 --- .history/src/Cube_20200512000204.cpp | 40 ----- .history/src/Cube_20200512005406.h | 26 --- .history/src/Cube_20200512005416.h | 26 --- .history/src/Quad_20200511171624.h | 0 .history/src/Quad_20200511171639.h | 19 --- .history/src/Quad_20200511171657.h | 22 --- .history/src/Quad_20200511171706.h | 23 --- .history/src/Quad_20200511171710.h | 23 --- .history/src/Quad_20200511171713.h | 23 --- .history/src/Quad_20200511171740.h | 23 --- .history/src/Quad_20200511175511.h | 27 --- .history/src/Quad_20200511175543.h | 29 ---- .history/src/Quad_20200511175550.h | 29 ---- .history/src/Quad_20200511175556.h | 29 ---- .history/src/Quad_20200511175559.h | 29 ---- .history/src/Quad_20200511175623.h | 29 ---- .history/src/Quad_20200511175926.h | 29 ---- .history/src/Quad_20200511175932.h | 29 ---- .history/src/Quad_20200511184026.h | 30 ---- .history/src/Quad_20200511184038.h | 30 ---- .history/src/Quad_20200511184041.h | 30 ---- .history/src/Quad_20200511184044.h | 29 ---- .history/src/Quad_20200511184053.h | 30 ---- .history/src/Quad_20200511184056.h | 30 ---- .history/src/Quad_20200511184723.h | 30 ---- .history/src/Quad_20200511184816.h | 30 ---- .history/src/Quad_20200511185058.h | 30 ---- .history/src/Quad_20200511200147.h | 30 ---- .history/src/Quad_20200511215736.cpp | 0 .history/src/Quad_20200511215936.cpp | 8 - .history/src/Quad_20200511220007.cpp | 8 - .history/src/Quad_20200511220027.h | 25 --- .history/src/Quad_20200511220042.cpp | 10 -- .history/src/Quad_20200511220043.cpp | 10 -- .history/src/Quad_20200511220045.cpp | 9 - .history/src/Quad_20200511220046.cpp | 10 -- .history/src/Quad_20200511220105.cpp | 14 -- .history/src/Quad_20200511220115.h | 25 --- .history/src/Quad_20200511220118.h | 21 --- .history/src/Quad_20200511220128.cpp | 14 -- .history/src/Quad_20200511220143.cpp | 22 --- .history/src/Quad_20200511220149.cpp | 22 --- .history/src/Quad_20200511220152.h | 13 -- .history/src/Quad_20200511220156.cpp | 22 --- .history/src/Quad_20200512000121.cpp | 22 --- .history/src/Quad_20200512000128.h | 13 -- .history/src/Quad_20200512000132.h | 13 -- .history/src/Quad_20200512000134.h | 13 -- .history/src/Quad_20200512000139.h | 13 -- .history/src/Quad_20200512010256.cpp | 23 --- .history/src/Quad_20200512010259.cpp | 23 --- .history/src/Quad_20200512010312.cpp | 24 --- .history/src/Quad_20200512010331.cpp | 24 --- .history/src/Quad_20200512010514.cpp | 23 --- .history/src/Vertex_20200511171556.h | 0 .history/src/Vertex_20200511171606.h | 4 - .history/src/Vertex_20200511172125.h | 9 - .history/src/Vertex_20200511172637.h | 9 - .history/src/Vertex_20200511180436.h | 10 -- .history/src/Vertex_20200511220207.cpp | 0 .history/src/Vertex_20200511220407.cpp | 7 - .history/src/Vertex_20200511220725.cpp | 9 - .history/src/Vertex_20200511220729.h | 6 - .history/src/Vertex_20200511220731.cpp | 9 - .history/src/Vertex_20200512010117.cpp | 10 -- .history/src/Vertex_20200512010119.cpp | 10 -- .history/src/Vertex_20200512010126.cpp | 10 -- .history/src/Vertex_20200512010150.cpp | 10 -- .history/src/Vertex_20200512010152.cpp | 11 -- .history/src/Vertex_20200512010338.cpp | 11 -- .history/src/color_20200511171454.h | 0 .history/src/color_20200511171508.h | 10 -- .history/src/gl_20200511140709.cpp | 38 ----- .history/src/gl_20200511175144.cpp | 38 ----- .history/src/main_20200511141624.cpp | 120 -------------- .history/src/main_20200511144632.cpp | 120 -------------- .history/src/main_20200511145101.cpp | 120 -------------- .history/src/main_20200511150605.cpp | 120 -------------- .history/src/main_20200511151949.cpp | 120 -------------- .history/src/main_20200511152157.cpp | 120 -------------- .history/src/main_20200511152206.cpp | 120 -------------- .history/src/main_20200511152249.cpp | 120 -------------- .history/src/main_20200511152326.cpp | 121 -------------- .history/src/main_20200511152538.cpp | 156 ----------------- .history/src/main_20200511152716.cpp | 151 ----------------- .history/src/main_20200511152836.cpp | 152 ----------------- .history/src/main_20200511152956.cpp | 152 ----------------- .history/src/main_20200511153000.cpp | 152 ----------------- .history/src/main_20200511153143.cpp | 152 ----------------- .history/src/main_20200511153153.cpp | 152 ----------------- .history/src/main_20200511153206.cpp | 152 ----------------- .history/src/main_20200511153351.cpp | 153 ----------------- .history/src/main_20200511153439.cpp | 153 ----------------- .history/src/main_20200511153501.cpp | 153 ----------------- .history/src/main_20200511153512.cpp | 153 ----------------- .history/src/main_20200511153525.cpp | 153 ----------------- .history/src/main_20200511153527.cpp | 153 ----------------- .history/src/main_20200511153536.cpp | 153 ----------------- .history/src/main_20200511153539.cpp | 153 ----------------- .history/src/main_20200511153548.cpp | 153 ----------------- .history/src/main_20200511153600.cpp | 153 ----------------- .history/src/main_20200511153617.cpp | 154 ----------------- .history/src/main_20200511153630.cpp | 154 ----------------- .history/src/main_20200511153654.cpp | 155 ----------------- .history/src/main_20200511153655.cpp | 155 ----------------- .history/src/main_20200511153712.cpp | 155 ----------------- .history/src/main_20200511153828.cpp | 155 ----------------- .history/src/main_20200511153840.cpp | 155 ----------------- .history/src/main_20200511153905.cpp | 155 ----------------- .history/src/main_20200511153910.cpp | 155 ----------------- .history/src/main_20200511153920.cpp | 155 ----------------- .history/src/main_20200511153926.cpp | 155 ----------------- .history/src/main_20200511153948.cpp | 155 ----------------- .history/src/main_20200511153957.cpp | 155 ----------------- .history/src/main_20200511154013.cpp | 155 ----------------- .history/src/main_20200511154031.cpp | 155 ----------------- .history/src/main_20200511154055.cpp | 155 ----------------- .history/src/main_20200511154127.cpp | 155 ----------------- .history/src/main_20200511163804.cpp | 155 ----------------- .history/src/main_20200511163907.cpp | 155 ----------------- .history/src/main_20200511163917.cpp | 155 ----------------- .history/src/main_20200511164038.cpp | 155 ----------------- .history/src/main_20200511164730.cpp | 153 ----------------- .history/src/main_20200511164948.cpp | 158 ------------------ .history/src/main_20200511165120.cpp | 163 ------------------ .history/src/main_20200511165122.cpp | 163 ------------------ .history/src/main_20200511165240.cpp | 168 ------------------- .history/src/main_20200511165437.cpp | 168 ------------------- .history/src/main_20200511165658.cpp | 171 ------------------- .history/src/main_20200511165816.cpp | 171 ------------------- .history/src/main_20200511165944.cpp | 181 -------------------- .history/src/main_20200511165954.cpp | 181 -------------------- .history/src/main_20200511170722.cpp | 187 --------------------- .history/src/main_20200511170815.cpp | 189 --------------------- .history/src/main_20200511170819.cpp | 189 --------------------- .history/src/main_20200511170856.cpp | 189 --------------------- .history/src/main_20200511170941.cpp | 189 --------------------- .history/src/main_20200511171006.cpp | 189 --------------------- .history/src/main_20200511171313.cpp | 201 ---------------------- .history/src/main_20200511171319.cpp | 202 ----------------------- .history/src/main_20200511171334.cpp | 202 ----------------------- .history/src/main_20200511171517.cpp | 192 --------------------- .history/src/main_20200511171546.cpp | 192 --------------------- .history/src/main_20200511171549.cpp | 192 --------------------- .history/src/main_20200511171615.cpp | 188 --------------------- .history/src/main_20200511171753.cpp | 166 ------------------- .history/src/main_20200511175200.cpp | 166 ------------------- .history/src/main_20200511175201.cpp | 166 ------------------- .history/src/main_20200511175225.cpp | 167 ------------------- .history/src/main_20200511175904.cpp | 167 ------------------- .history/src/main_20200511180500.cpp | 167 ------------------- .history/src/main_20200511185350.cpp | 167 ------------------- .history/src/main_20200511185420.cpp | 134 --------------- .history/src/main_20200511191949.cpp | 135 --------------- .history/src/main_20200511192159.cpp | 139 ---------------- .history/src/main_20200511194222.cpp | 141 ---------------- .history/src/main_20200511194426.cpp | 146 ---------------- .history/src/main_20200511194624.cpp | 148 ----------------- .history/src/main_20200511194806.cpp | 150 ----------------- .history/src/main_20200511194836.cpp | 151 ----------------- .history/src/main_20200511194848.cpp | 151 ----------------- .history/src/main_20200511194909.cpp | 152 ----------------- .history/src/main_20200511194919.cpp | 151 ----------------- .history/src/main_20200511195619.cpp | 152 ----------------- .history/src/main_20200511195626.cpp | 152 ----------------- .history/src/main_20200511195635.cpp | 152 ----------------- .history/src/main_20200511195700.cpp | 152 ----------------- .history/src/main_20200511195754.cpp | 155 ----------------- .history/src/main_20200511195830.cpp | 158 ------------------ .history/src/main_20200511195907.cpp | 158 ------------------ .history/src/main_20200511195930.cpp | 158 ------------------ .history/src/main_20200511195933.cpp | 158 ------------------ .history/src/main_20200511195942.cpp | 158 ------------------ .history/src/main_20200511200052.cpp | 158 ------------------ .history/src/main_20200511200156.cpp | 158 ------------------ .history/src/main_20200511235857.cpp | 158 ------------------ .history/src/main_20200511235900.cpp | 158 ------------------ .history/src/main_20200511235911.cpp | 159 ------------------ .history/src/main_20200511235939.cpp | 159 ------------------ .history/src/main_20200512000104.cpp | 159 ------------------ .history/src/main_20200512000113.cpp | 159 ------------------ .history/src/main_20200512000411.cpp | 153 ----------------- .history/src/main_20200512000429.cpp | 154 ----------------- .history/src/main_20200512000549.cpp | 154 ----------------- .history/src/main_20200512000614.cpp | 154 ----------------- .history/src/main_20200512010342.cpp | 154 ----------------- .history/src/main_20200512010405.cpp | 155 ----------------- .history/src/main_20200512010408.cpp | 155 ----------------- .history/src/main_20200512010440.cpp | 157 ------------------ .history/src/main_20200512010451.cpp | 159 ------------------ .history/src/main_20200512010535.cpp | 159 ------------------ .history/src/main_20200512010630.cpp | 159 ------------------ .history/src/main_20200512010633.cpp | 159 ------------------ .history/src/main_20200512010641.cpp | 159 ------------------ .history/src/main_20200512010651.cpp | 160 ------------------ .history/src/main_20200512010809.cpp | 164 ------------------ .history/src/main_20200512010815.cpp | 164 ------------------ .history/src/main_20200512010819.cpp | 164 ------------------ .history/src/main_20200512010823.cpp | 164 ------------------ .history/src/main_20200512010947.cpp | 164 ------------------ .history/src/main_20200512011009.cpp | 163 ------------------ .history/src/main_20200512011055.cpp | 163 ------------------ .history/src/main_20200512011126.cpp | 164 ------------------ .history/src/main_20200512011142.cpp | 165 ------------------ .history/src/main_20200512011153.cpp | 167 ------------------- .history/src/main_20200512011236.cpp | 168 ------------------- .history/src/main_20200512011317.cpp | 160 ------------------ .history/src/main_20200512011351.cpp | 162 ------------------ .history/src/main_20200512011417.cpp | 163 ------------------ .history/src/main_20200512011436.cpp | 164 ------------------ .history/src/main_20200512011507.cpp | 164 ------------------ .history/src/main_20200512011542.cpp | 164 ------------------ .history/src/main_20200512011547.cpp | 164 ------------------ .history/src/main_20200512011559.cpp | 164 ------------------ .history/src/main_20200512011641.cpp | 164 ------------------ .history/src/main_20200512011807.cpp | 162 ------------------ .history/src/main_20200512011831.cpp | 162 ------------------ .history/src/main_20200512011844.cpp | 162 ------------------ .history/src/main_20200512011858.cpp | 162 ------------------ .history/src/main_20200512011906.cpp | 160 ------------------ .kdev4/hs-cpp.kdev4 | 2 - .vscode/settings.json | 25 --- hs-cpp.kdev4 | 4 - 495 files changed, 31491 deletions(-) delete mode 100644 .history/Makefile_20200511140830 delete mode 100644 .history/Makefile_20200511200301 delete mode 100644 .history/Makefile_20200511200400 delete mode 100644 .history/Makefile_20200511201938 delete mode 100644 .history/Makefile_20200511201953 delete mode 100644 .history/Makefile_20200511202032 delete mode 100644 .history/Makefile_20200511202051 delete mode 100644 .history/Makefile_20200511202102 delete mode 100644 .history/Makefile_20200511202110 delete mode 100644 .history/Makefile_20200511202111 delete mode 100644 .history/Makefile_20200511202113 delete mode 100644 .history/Makefile_20200511202207 delete mode 100644 .history/Makefile_20200511202225 delete mode 100644 .history/Makefile_20200511202244 delete mode 100644 .history/Makefile_20200511202254 delete mode 100644 .history/Makefile_20200511222404 delete mode 100644 .history/Makefile_20200511222408 delete mode 100644 .history/Makefile_20200511222417 delete mode 100644 .history/Makefile_20200511222546 delete mode 100644 .history/Makefile_20200511222552 delete mode 100644 .history/Makefile_20200511222632 delete mode 100644 .history/Makefile_20200511223118 delete mode 100644 .history/Makefile_20200511232417 delete mode 100644 .history/Makefile_20200511232942 delete mode 100644 .history/Makefile_20200511232949 delete mode 100644 .history/Makefile_20200511233258 delete mode 100644 .history/Makefile_20200511233332 delete mode 100644 .history/Makefile_20200511233403 delete mode 100644 .history/Makefile_20200511233423 delete mode 100644 .history/Makefile_20200511233451 delete mode 100644 .history/Makefile_20200511233512 delete mode 100644 .history/Makefile_20200511233531 delete mode 100644 .history/Makefile_20200511233537 delete mode 100644 .history/Makefile_20200511233619 delete mode 100644 .history/Makefile_20200511233631 delete mode 100644 .history/Makefile_20200511233633 delete mode 100644 .history/Makefile_20200511233703 delete mode 100644 .history/Makefile_20200511233707 delete mode 100644 .history/Makefile_20200511233714 delete mode 100644 .history/Makefile_20200511233726 delete mode 100644 .history/Makefile_20200511233826 delete mode 100644 .history/Makefile_20200511233926 delete mode 100644 .history/Makefile_20200511233935 delete mode 100644 .history/Makefile_20200511233946 delete mode 100644 .history/Makefile_20200511234024 delete mode 100644 .history/Makefile_20200511234030 delete mode 100644 .history/Makefile_20200511234130 delete mode 100644 .history/Makefile_20200511234218 delete mode 100644 .history/Makefile_20200511234223 delete mode 100644 .history/Makefile_20200511234429 delete mode 100644 .history/Makefile_20200511234457 delete mode 100644 .history/Makefile_20200511234505 delete mode 100644 .history/Makefile_20200511234522 delete mode 100644 .history/Makefile_20200511234615 delete mode 100644 .history/Makefile_20200511234621 delete mode 100644 .history/Makefile_20200511234639 delete mode 100644 .history/Makefile_20200511234646 delete mode 100644 .history/Makefile_20200511235501 delete mode 100644 .history/Makefile_20200511235522 delete mode 100644 .history/Makefile_20200511235543 delete mode 100644 .history/Makefile_20200511235607 delete mode 100644 .history/Makefile_20200511235632 delete mode 100644 .history/Makefile_20200511235725 delete mode 100644 .history/Makefile_20200511235727 delete mode 100644 .history/Makefile_20200511235737 delete mode 100644 .history/Makefile_20200511235920 delete mode 100644 .history/Makefile_20200512000709 delete mode 100644 .history/Makefile_20200512001624 delete mode 100644 .history/Makefile_20200512001633 delete mode 100644 .history/Makefile_20200512001749 delete mode 100644 .history/Makefile_20200512001840 delete mode 100644 .history/Makefile_20200512001924 delete mode 100644 .history/Makefile_20200512001959 delete mode 100644 .history/Makefile_20200512002002 delete mode 100644 .history/Makefile_20200512002353 delete mode 100644 .history/Makefile_20200512002453 delete mode 100644 .history/Makefile_20200512002502 delete mode 100644 .history/Makefile_20200512002516 delete mode 100644 .history/Makefile_20200512002533 delete mode 100644 .history/Makefile_20200512002632 delete mode 100644 .history/Makefile_20200512002654 delete mode 100644 .history/Makefile_20200512002708 delete mode 100644 .history/Makefile_20200512002742 delete mode 100644 .history/Makefile_20200512002756 delete mode 100644 .history/Makefile_20200512003649 delete mode 100644 .history/Makefile_20200512003657 delete mode 100644 .history/Makefile_20200512003732 delete mode 100644 .history/Makefile_20200512003757 delete mode 100644 .history/Makefile_20200512003818 delete mode 100644 .history/Makefile_20200512003822 delete mode 100644 .history/Makefile_20200512003829 delete mode 100644 .history/Makefile_20200512003842 delete mode 100644 .history/Makefile_20200512003911 delete mode 100644 .history/Makefile_20200512003927 delete mode 100644 .history/Makefile_20200512003938 delete mode 100644 .history/Makefile_20200512004016 delete mode 100644 .history/Makefile_20200512004205 delete mode 100644 .history/Makefile_20200512005117 delete mode 100644 .history/Makefile_20200512005124 delete mode 100644 .history/Makefile_20200512005227 delete mode 100644 .history/Makefile_20200512005507 delete mode 100644 .history/Makefile_20200512005538 delete mode 100644 .history/Makefile_20200512005607 delete mode 100644 .history/Makefile_20200512005648 delete mode 100644 .history/Makefile_20200512005729 delete mode 100644 .history/Makefile_20200512005741 delete mode 100644 .history/Makefile_20200512005803 delete mode 100644 .history/Makefile_20200512005826 delete mode 100644 .history/Makefile_20200512005851 delete mode 100644 .history/Makefile_20200512005925 delete mode 100644 .history/Makefile_20200512005944 delete mode 100644 .history/Makefile_20200512010012 delete mode 100644 .history/Makefile_20200512095009 delete mode 100644 .history/Makefile_20200512095614 delete mode 100644 .history/Makefile_20200512095616 delete mode 100644 .history/Makefile_20200512113711 delete mode 100644 .history/Makefile_20200512122020 delete mode 100644 .history/Makefile_20200512122058 delete mode 100644 .history/Makefile_20200512122134 delete mode 100644 .history/Makefile_20200512122202 delete mode 100644 .history/Makefile_20200512122220 delete mode 100644 .history/Makefile_20200512122241 delete mode 100644 .history/Makefile_20200512122259 delete mode 100644 .history/Makefile_20200512122307 delete mode 100644 .history/Makefile_20200512122440 delete mode 100644 .history/Makefile_20200512122803 delete mode 100644 .history/Makefile_20200512122821 delete mode 100644 .history/Makefile_20200512122910 delete mode 100644 .history/Makefile_20200512145408 delete mode 100644 .history/Makefile_20200512145509 delete mode 100644 .history/Makefile_20200512145543 delete mode 100644 .history/Makefile_20200512145729 delete mode 100644 .history/Makefile_20200512145745 delete mode 100644 .history/Makefile_20200513122930 delete mode 100644 .history/Makefile_20200513122959 delete mode 100644 .history/Makefile_20200513123017 delete mode 100644 .history/Makefile_20200513123140 delete mode 100644 .history/Makefile_20200513123200 delete mode 100644 .history/Makefile_20200513123243 delete mode 100644 .history/Makefile_20200513123410 delete mode 100644 .history/Makefile_20200513123423 delete mode 100644 .history/Makefile_20200513123433 delete mode 100644 .history/Makefile_20200513123441 delete mode 100644 .history/Makefile_20200513123514 delete mode 100644 .history/Makefile_20200513123603 delete mode 100644 .history/Makefile_20200513123629 delete mode 100644 .history/Makefile_20200513123759 delete mode 100644 .history/Makefile_20200513123840 delete mode 100644 .history/Makefile_20200513123854 delete mode 100644 .history/Makefile_20200513123905 delete mode 100644 .history/Makefile_20200513124216 delete mode 100644 .history/Makefile_20200513124320 delete mode 100644 .history/Makefile_20200513124438 delete mode 100644 .history/Makefile_20200513124541 delete mode 100644 .history/Makefile_20200513124558 delete mode 100644 .history/Makefile_20200513124608 delete mode 100644 .history/Makefile_20200513124624 delete mode 100644 .history/Makefile_20200513125013 delete mode 100644 .history/Makefile_20200513125052 delete mode 100644 .history/Makefile_20200513125126 delete mode 100644 .history/Makefile_20200513125143 delete mode 100644 .history/Makefile_20200513125206 delete mode 100644 .history/Makefile_20200513125218 delete mode 100644 .history/Makefile_20200513125946 delete mode 100644 .history/Makefile_20200513130104 delete mode 100644 .history/Makefile_20200513130117 delete mode 100644 .history/Makefile_20200513130353 delete mode 100644 .history/Makefile_20200513130432 delete mode 100644 .history/Makefile_20200513130456 delete mode 100644 .history/Makefile_20200513130508 delete mode 100644 .history/Makefile_20200513130809 delete mode 100644 .history/Makefile_20200513130839 delete mode 100644 .history/Makefile_20200513130844 delete mode 100644 .history/Makefile_20200513130854 delete mode 100644 .history/Makefile_20200513130906 delete mode 100644 .history/Makefile_20200513130915 delete mode 100644 .history/Makefile_20200513130933 delete mode 100644 .history/Makefile_20200513131004 delete mode 100644 .history/Makefile_20200513131017 delete mode 100644 .history/Makefile_20200513131041 delete mode 100644 .history/Makefile_20200513131048 delete mode 100644 .history/Makefile_20200513131123 delete mode 100644 .history/Makefile_20200513131132 delete mode 100644 .history/Makefile_20200513131146 delete mode 100644 .history/Makefile_20200513131336 delete mode 100644 .history/Makefile_20200513131344 delete mode 100644 .history/Makefile_20200513131602 delete mode 100644 .history/Makefile_20200513131621 delete mode 100644 .history/Makefile_20200513131845 delete mode 100644 .history/Makefile_20200513131940 delete mode 100644 .history/Makefile_20200513132006 delete mode 100644 .history/Makefile_20200513132016 delete mode 100644 .history/Makefile_20200513132905 delete mode 100644 .history/Makefile_20200513132931 delete mode 100644 .history/Makefile_20200513132942 delete mode 100644 .history/Makefile_20200513134126 delete mode 100644 .history/Makefile_20200513134548 delete mode 100644 .history/Makefile_20200513135257 delete mode 100644 .history/generatecube_20200511164401.lua delete mode 100644 .history/generatecube_20200511171029.lua delete mode 100644 .history/src/Color_20200511171542.h delete mode 100644 .history/src/Color_20200511175158.h delete mode 100644 .history/src/Color_20200511175840.h delete mode 100644 .history/src/Color_20200511175845.h delete mode 100644 .history/src/Color_20200511175902.h delete mode 100644 .history/src/Color_20200511180426.h delete mode 100644 .history/src/Color_20200511180509.h delete mode 100644 .history/src/Color_20200511184059.h delete mode 100644 .history/src/Color_20200511184834.h delete mode 100644 .history/src/Color_20200511184840.h delete mode 100644 .history/src/Color_20200511185132.h delete mode 100644 .history/src/Color_20200511195616.h delete mode 100644 .history/src/Color_20200511214107.cpp delete mode 100644 .history/src/Color_20200511214344.cpp delete mode 100644 .history/src/Color_20200511214346.cpp delete mode 100644 .history/src/Color_20200511214352.cpp delete mode 100644 .history/src/Color_20200511214540.h delete mode 100644 .history/src/Color_20200511214543.cpp delete mode 100644 .history/src/Color_20200511214549.cpp delete mode 100644 .history/src/Color_20200511214553.h delete mode 100644 .history/src/Color_20200511214556.h delete mode 100644 .history/src/Color_20200511214607.h delete mode 100644 .history/src/Color_20200511214903.h delete mode 100644 .history/src/Color_20200511214929.cpp delete mode 100644 .history/src/Color_20200511215000.cpp delete mode 100644 .history/src/Color_20200511215006.cpp delete mode 100644 .history/src/Color_20200511215017.cpp delete mode 100644 .history/src/Color_20200511215019.cpp delete mode 100644 .history/src/Color_20200511215026.cpp delete mode 100644 .history/src/Color_20200511215048.cpp delete mode 100644 .history/src/Color_20200512000019.h delete mode 100644 .history/src/Color_20200512000031.h delete mode 100644 .history/src/Color_20200512000048.cpp delete mode 100644 .history/src/Color_20200512011729.h delete mode 100644 .history/src/Color_20200512011730.h delete mode 100644 .history/src/Cube_20200511182530.h delete mode 100644 .history/src/Cube_20200511182542.h delete mode 100644 .history/src/Cube_20200511183329.h delete mode 100644 .history/src/Cube_20200511183343.h delete mode 100644 .history/src/Cube_20200511183548.h delete mode 100644 .history/src/Cube_20200511184002.h delete mode 100644 .history/src/Cube_20200511184009.h delete mode 100644 .history/src/Cube_20200511184116.h delete mode 100644 .history/src/Cube_20200511184202.h delete mode 100644 .history/src/Cube_20200511184203.h delete mode 100644 .history/src/Cube_20200511184209.h delete mode 100644 .history/src/Cube_20200511184212.h delete mode 100644 .history/src/Cube_20200511184523.h delete mode 100644 .history/src/Cube_20200511184555.h delete mode 100644 .history/src/Cube_20200511184633.h delete mode 100644 .history/src/Cube_20200511184644.h delete mode 100644 .history/src/Cube_20200511185025.h delete mode 100644 .history/src/Cube_20200511200128.h delete mode 100644 .history/src/Cube_20200511215053.cpp delete mode 100644 .history/src/Cube_20200511215349.cpp delete mode 100644 .history/src/Cube_20200511215400.cpp delete mode 100644 .history/src/Cube_20200511215430.cpp delete mode 100644 .history/src/Cube_20200511215539.cpp delete mode 100644 .history/src/Cube_20200511215544.cpp delete mode 100644 .history/src/Cube_20200511215553.h delete mode 100644 .history/src/Cube_20200511215555.h delete mode 100644 .history/src/Cube_20200511215557.h delete mode 100644 .history/src/Cube_20200511215604.h delete mode 100644 .history/src/Cube_20200511215610.h delete mode 100644 .history/src/Cube_20200511215619.h delete mode 100644 .history/src/Cube_20200511215638.cpp delete mode 100644 .history/src/Cube_20200511215641.cpp delete mode 100644 .history/src/Cube_20200511215657.h delete mode 100644 .history/src/Cube_20200511215708.h delete mode 100644 .history/src/Cube_20200511215722.cpp delete mode 100644 .history/src/Cube_20200512000150.h delete mode 100644 .history/src/Cube_20200512000152.h delete mode 100644 .history/src/Cube_20200512000204.cpp delete mode 100644 .history/src/Cube_20200512005406.h delete mode 100644 .history/src/Cube_20200512005416.h delete mode 100644 .history/src/Quad_20200511171624.h delete mode 100644 .history/src/Quad_20200511171639.h delete mode 100644 .history/src/Quad_20200511171657.h delete mode 100644 .history/src/Quad_20200511171706.h delete mode 100644 .history/src/Quad_20200511171710.h delete mode 100644 .history/src/Quad_20200511171713.h delete mode 100644 .history/src/Quad_20200511171740.h delete mode 100644 .history/src/Quad_20200511175511.h delete mode 100644 .history/src/Quad_20200511175543.h delete mode 100644 .history/src/Quad_20200511175550.h delete mode 100644 .history/src/Quad_20200511175556.h delete mode 100644 .history/src/Quad_20200511175559.h delete mode 100644 .history/src/Quad_20200511175623.h delete mode 100644 .history/src/Quad_20200511175926.h delete mode 100644 .history/src/Quad_20200511175932.h delete mode 100644 .history/src/Quad_20200511184026.h delete mode 100644 .history/src/Quad_20200511184038.h delete mode 100644 .history/src/Quad_20200511184041.h delete mode 100644 .history/src/Quad_20200511184044.h delete mode 100644 .history/src/Quad_20200511184053.h delete mode 100644 .history/src/Quad_20200511184056.h delete mode 100644 .history/src/Quad_20200511184723.h delete mode 100644 .history/src/Quad_20200511184816.h delete mode 100644 .history/src/Quad_20200511185058.h delete mode 100644 .history/src/Quad_20200511200147.h delete mode 100644 .history/src/Quad_20200511215736.cpp delete mode 100644 .history/src/Quad_20200511215936.cpp delete mode 100644 .history/src/Quad_20200511220007.cpp delete mode 100644 .history/src/Quad_20200511220027.h delete mode 100644 .history/src/Quad_20200511220042.cpp delete mode 100644 .history/src/Quad_20200511220043.cpp delete mode 100644 .history/src/Quad_20200511220045.cpp delete mode 100644 .history/src/Quad_20200511220046.cpp delete mode 100644 .history/src/Quad_20200511220105.cpp delete mode 100644 .history/src/Quad_20200511220115.h delete mode 100644 .history/src/Quad_20200511220118.h delete mode 100644 .history/src/Quad_20200511220128.cpp delete mode 100644 .history/src/Quad_20200511220143.cpp delete mode 100644 .history/src/Quad_20200511220149.cpp delete mode 100644 .history/src/Quad_20200511220152.h delete mode 100644 .history/src/Quad_20200511220156.cpp delete mode 100644 .history/src/Quad_20200512000121.cpp delete mode 100644 .history/src/Quad_20200512000128.h delete mode 100644 .history/src/Quad_20200512000132.h delete mode 100644 .history/src/Quad_20200512000134.h delete mode 100644 .history/src/Quad_20200512000139.h delete mode 100644 .history/src/Quad_20200512010256.cpp delete mode 100644 .history/src/Quad_20200512010259.cpp delete mode 100644 .history/src/Quad_20200512010312.cpp delete mode 100644 .history/src/Quad_20200512010331.cpp delete mode 100644 .history/src/Quad_20200512010514.cpp delete mode 100644 .history/src/Vertex_20200511171556.h delete mode 100644 .history/src/Vertex_20200511171606.h delete mode 100644 .history/src/Vertex_20200511172125.h delete mode 100644 .history/src/Vertex_20200511172637.h delete mode 100644 .history/src/Vertex_20200511180436.h delete mode 100644 .history/src/Vertex_20200511220207.cpp delete mode 100644 .history/src/Vertex_20200511220407.cpp delete mode 100644 .history/src/Vertex_20200511220725.cpp delete mode 100644 .history/src/Vertex_20200511220729.h delete mode 100644 .history/src/Vertex_20200511220731.cpp delete mode 100644 .history/src/Vertex_20200512010117.cpp delete mode 100644 .history/src/Vertex_20200512010119.cpp delete mode 100644 .history/src/Vertex_20200512010126.cpp delete mode 100644 .history/src/Vertex_20200512010150.cpp delete mode 100644 .history/src/Vertex_20200512010152.cpp delete mode 100644 .history/src/Vertex_20200512010338.cpp delete mode 100644 .history/src/color_20200511171454.h delete mode 100644 .history/src/color_20200511171508.h delete mode 100644 .history/src/gl_20200511140709.cpp delete mode 100644 .history/src/gl_20200511175144.cpp delete mode 100644 .history/src/main_20200511141624.cpp delete mode 100644 .history/src/main_20200511144632.cpp delete mode 100644 .history/src/main_20200511145101.cpp delete mode 100644 .history/src/main_20200511150605.cpp delete mode 100644 .history/src/main_20200511151949.cpp delete mode 100644 .history/src/main_20200511152157.cpp delete mode 100644 .history/src/main_20200511152206.cpp delete mode 100644 .history/src/main_20200511152249.cpp delete mode 100644 .history/src/main_20200511152326.cpp delete mode 100644 .history/src/main_20200511152538.cpp delete mode 100644 .history/src/main_20200511152716.cpp delete mode 100644 .history/src/main_20200511152836.cpp delete mode 100644 .history/src/main_20200511152956.cpp delete mode 100644 .history/src/main_20200511153000.cpp delete mode 100644 .history/src/main_20200511153143.cpp delete mode 100644 .history/src/main_20200511153153.cpp delete mode 100644 .history/src/main_20200511153206.cpp delete mode 100644 .history/src/main_20200511153351.cpp delete mode 100644 .history/src/main_20200511153439.cpp delete mode 100644 .history/src/main_20200511153501.cpp delete mode 100644 .history/src/main_20200511153512.cpp delete mode 100644 .history/src/main_20200511153525.cpp delete mode 100644 .history/src/main_20200511153527.cpp delete mode 100644 .history/src/main_20200511153536.cpp delete mode 100644 .history/src/main_20200511153539.cpp delete mode 100644 .history/src/main_20200511153548.cpp delete mode 100644 .history/src/main_20200511153600.cpp delete mode 100644 .history/src/main_20200511153617.cpp delete mode 100644 .history/src/main_20200511153630.cpp delete mode 100644 .history/src/main_20200511153654.cpp delete mode 100644 .history/src/main_20200511153655.cpp delete mode 100644 .history/src/main_20200511153712.cpp delete mode 100644 .history/src/main_20200511153828.cpp delete mode 100644 .history/src/main_20200511153840.cpp delete mode 100644 .history/src/main_20200511153905.cpp delete mode 100644 .history/src/main_20200511153910.cpp delete mode 100644 .history/src/main_20200511153920.cpp delete mode 100644 .history/src/main_20200511153926.cpp delete mode 100644 .history/src/main_20200511153948.cpp delete mode 100644 .history/src/main_20200511153957.cpp delete mode 100644 .history/src/main_20200511154013.cpp delete mode 100644 .history/src/main_20200511154031.cpp delete mode 100644 .history/src/main_20200511154055.cpp delete mode 100644 .history/src/main_20200511154127.cpp delete mode 100644 .history/src/main_20200511163804.cpp delete mode 100644 .history/src/main_20200511163907.cpp delete mode 100644 .history/src/main_20200511163917.cpp delete mode 100644 .history/src/main_20200511164038.cpp delete mode 100644 .history/src/main_20200511164730.cpp delete mode 100644 .history/src/main_20200511164948.cpp delete mode 100644 .history/src/main_20200511165120.cpp delete mode 100644 .history/src/main_20200511165122.cpp delete mode 100644 .history/src/main_20200511165240.cpp delete mode 100644 .history/src/main_20200511165437.cpp delete mode 100644 .history/src/main_20200511165658.cpp delete mode 100644 .history/src/main_20200511165816.cpp delete mode 100644 .history/src/main_20200511165944.cpp delete mode 100644 .history/src/main_20200511165954.cpp delete mode 100644 .history/src/main_20200511170722.cpp delete mode 100644 .history/src/main_20200511170815.cpp delete mode 100644 .history/src/main_20200511170819.cpp delete mode 100644 .history/src/main_20200511170856.cpp delete mode 100644 .history/src/main_20200511170941.cpp delete mode 100644 .history/src/main_20200511171006.cpp delete mode 100644 .history/src/main_20200511171313.cpp delete mode 100644 .history/src/main_20200511171319.cpp delete mode 100644 .history/src/main_20200511171334.cpp delete mode 100644 .history/src/main_20200511171517.cpp delete mode 100644 .history/src/main_20200511171546.cpp delete mode 100644 .history/src/main_20200511171549.cpp delete mode 100644 .history/src/main_20200511171615.cpp delete mode 100644 .history/src/main_20200511171753.cpp delete mode 100644 .history/src/main_20200511175200.cpp delete mode 100644 .history/src/main_20200511175201.cpp delete mode 100644 .history/src/main_20200511175225.cpp delete mode 100644 .history/src/main_20200511175904.cpp delete mode 100644 .history/src/main_20200511180500.cpp delete mode 100644 .history/src/main_20200511185350.cpp delete mode 100644 .history/src/main_20200511185420.cpp delete mode 100644 .history/src/main_20200511191949.cpp delete mode 100644 .history/src/main_20200511192159.cpp delete mode 100644 .history/src/main_20200511194222.cpp delete mode 100644 .history/src/main_20200511194426.cpp delete mode 100644 .history/src/main_20200511194624.cpp delete mode 100644 .history/src/main_20200511194806.cpp delete mode 100644 .history/src/main_20200511194836.cpp delete mode 100644 .history/src/main_20200511194848.cpp delete mode 100644 .history/src/main_20200511194909.cpp delete mode 100644 .history/src/main_20200511194919.cpp delete mode 100644 .history/src/main_20200511195619.cpp delete mode 100644 .history/src/main_20200511195626.cpp delete mode 100644 .history/src/main_20200511195635.cpp delete mode 100644 .history/src/main_20200511195700.cpp delete mode 100644 .history/src/main_20200511195754.cpp delete mode 100644 .history/src/main_20200511195830.cpp delete mode 100644 .history/src/main_20200511195907.cpp delete mode 100644 .history/src/main_20200511195930.cpp delete mode 100644 .history/src/main_20200511195933.cpp delete mode 100644 .history/src/main_20200511195942.cpp delete mode 100644 .history/src/main_20200511200052.cpp delete mode 100644 .history/src/main_20200511200156.cpp delete mode 100644 .history/src/main_20200511235857.cpp delete mode 100644 .history/src/main_20200511235900.cpp delete mode 100644 .history/src/main_20200511235911.cpp delete mode 100644 .history/src/main_20200511235939.cpp delete mode 100644 .history/src/main_20200512000104.cpp delete mode 100644 .history/src/main_20200512000113.cpp delete mode 100644 .history/src/main_20200512000411.cpp delete mode 100644 .history/src/main_20200512000429.cpp delete mode 100644 .history/src/main_20200512000549.cpp delete mode 100644 .history/src/main_20200512000614.cpp delete mode 100644 .history/src/main_20200512010342.cpp delete mode 100644 .history/src/main_20200512010405.cpp delete mode 100644 .history/src/main_20200512010408.cpp delete mode 100644 .history/src/main_20200512010440.cpp delete mode 100644 .history/src/main_20200512010451.cpp delete mode 100644 .history/src/main_20200512010535.cpp delete mode 100644 .history/src/main_20200512010630.cpp delete mode 100644 .history/src/main_20200512010633.cpp delete mode 100644 .history/src/main_20200512010641.cpp delete mode 100644 .history/src/main_20200512010651.cpp delete mode 100644 .history/src/main_20200512010809.cpp delete mode 100644 .history/src/main_20200512010815.cpp delete mode 100644 .history/src/main_20200512010819.cpp delete mode 100644 .history/src/main_20200512010823.cpp delete mode 100644 .history/src/main_20200512010947.cpp delete mode 100644 .history/src/main_20200512011009.cpp delete mode 100644 .history/src/main_20200512011055.cpp delete mode 100644 .history/src/main_20200512011126.cpp delete mode 100644 .history/src/main_20200512011142.cpp delete mode 100644 .history/src/main_20200512011153.cpp delete mode 100644 .history/src/main_20200512011236.cpp delete mode 100644 .history/src/main_20200512011317.cpp delete mode 100644 .history/src/main_20200512011351.cpp delete mode 100644 .history/src/main_20200512011417.cpp delete mode 100644 .history/src/main_20200512011436.cpp delete mode 100644 .history/src/main_20200512011507.cpp delete mode 100644 .history/src/main_20200512011542.cpp delete mode 100644 .history/src/main_20200512011547.cpp delete mode 100644 .history/src/main_20200512011559.cpp delete mode 100644 .history/src/main_20200512011641.cpp delete mode 100644 .history/src/main_20200512011807.cpp delete mode 100644 .history/src/main_20200512011831.cpp delete mode 100644 .history/src/main_20200512011844.cpp delete mode 100644 .history/src/main_20200512011858.cpp delete mode 100644 .history/src/main_20200512011906.cpp delete mode 100644 .kdev4/hs-cpp.kdev4 delete mode 100644 .vscode/settings.json delete mode 100644 hs-cpp.kdev4 diff --git a/.history/Makefile_20200511140830 b/.history/Makefile_20200511140830 deleted file mode 100644 index c088c1a..0000000 --- a/.history/Makefile_20200511140830 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511200301 b/.history/Makefile_20200511200301 deleted file mode 100644 index c088c1a..0000000 --- a/.history/Makefile_20200511200301 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511200400 b/.history/Makefile_20200511200400 deleted file mode 100644 index 19eaee0..0000000 --- a/.history/Makefile_20200511200400 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp -targets += ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511201938 b/.history/Makefile_20200511201938 deleted file mode 100644 index 19eaee0..0000000 --- a/.history/Makefile_20200511201938 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp -targets += ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511201953 b/.history/Makefile_20200511201953 deleted file mode 100644 index 60451b1..0000000 --- a/.history/Makefile_20200511201953 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202032 b/.history/Makefile_20200511202032 deleted file mode 100644 index a0eda76..0000000 --- a/.history/Makefile_20200511202032 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) $(targets) -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202051 b/.history/Makefile_20200511202051 deleted file mode 100644 index 3254380..0000000 --- a/.history/Makefile_20200511202051 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) $(targets) -o ./bin/ $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202102 b/.history/Makefile_20200511202102 deleted file mode 100644 index 3bd73c7..0000000 --- a/.history/Makefile_20200511202102 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) $(targets) -o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202110 b/.history/Makefile_20200511202110 deleted file mode 100644 index 9935baf..0000000 --- a/.history/Makefile_20200511202110 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) $(targets)$(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202111 b/.history/Makefile_20200511202111 deleted file mode 100644 index 9935baf..0000000 --- a/.history/Makefile_20200511202111 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) $(targets)$(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202113 b/.history/Makefile_20200511202113 deleted file mode 100644 index 88a9863..0000000 --- a/.history/Makefile_20200511202113 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) $(targets) $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202207 b/.history/Makefile_20200511202207 deleted file mode 100644 index 52ca0fd..0000000 --- a/.history/Makefile_20200511202207 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202225 b/.history/Makefile_20200511202225 deleted file mode 100644 index 0fa6c21..0000000 --- a/.history/Makefile_20200511202225 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./src/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202244 b/.history/Makefile_20200511202244 deleted file mode 100644 index 60451b1..0000000 --- a/.history/Makefile_20200511202244 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511202254 b/.history/Makefile_20200511202254 deleted file mode 100644 index 60451b1..0000000 --- a/.history/Makefile_20200511202254 +++ /dev/null @@ -1,16 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511222404 b/.history/Makefile_20200511222404 deleted file mode 100644 index ced9bae..0000000 --- a/.history/Makefile_20200511222404 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511222408 b/.history/Makefile_20200511222408 deleted file mode 100644 index c3d6287..0000000 --- a/.history/Makefile_20200511222408 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511222417 b/.history/Makefile_20200511222417 deleted file mode 100644 index c3d6287..0000000 --- a/.history/Makefile_20200511222417 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511222546 b/.history/Makefile_20200511222546 deleted file mode 100644 index c3d6287..0000000 --- a/.history/Makefile_20200511222546 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511222552 b/.history/Makefile_20200511222552 deleted file mode 100644 index c3d6287..0000000 --- a/.history/Makefile_20200511222552 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o diff --git a/.history/Makefile_20200511222632 b/.history/Makefile_20200511222632 deleted file mode 100644 index 4af94b0..0000000 --- a/.history/Makefile_20200511222632 +++ /dev/null @@ -1,17 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -targets = ./src/*.cpp ./src/*.h - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511223118 b/.history/Makefile_20200511223118 deleted file mode 100644 index fc3f2a5..0000000 --- a/.history/Makefile_20200511223118 +++ /dev/null @@ -1,20 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -Color.o: Color.* ; - - -main.o: - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511232417 b/.history/Makefile_20200511232417 deleted file mode 100644 index c59dad6..0000000 --- a/.history/Makefile_20200511232417 +++ /dev/null @@ -1,20 +0,0 @@ -CC = clang -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall - -all: build ; - -Color.o: Color.c Color.h ; - - -main.o: - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511232942 b/.history/Makefile_20200511232942 deleted file mode 100644 index 55bc55d..0000000 --- a/.history/Makefile_20200511232942 +++ /dev/null @@ -1,21 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.c Color.h ; - - - -main.o: - -build: $(targets) ; - $(CC) $(DBG) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511232949 b/.history/Makefile_20200511232949 deleted file mode 100644 index 2cc3e72..0000000 --- a/.history/Makefile_20200511232949 +++ /dev/null @@ -1,21 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.c Color.h ; - - - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233258 b/.history/Makefile_20200511233258 deleted file mode 100644 index e2c9d7e..0000000 --- a/.history/Makefile_20200511233258 +++ /dev/null @@ -1,19 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233332 b/.history/Makefile_20200511233332 deleted file mode 100644 index cb6dd84..0000000 --- a/.history/Makefile_20200511233332 +++ /dev/null @@ -1,20 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233403 b/.history/Makefile_20200511233403 deleted file mode 100644 index 2933079..0000000 --- a/.history/Makefile_20200511233403 +++ /dev/null @@ -1,21 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233423 b/.history/Makefile_20200511233423 deleted file mode 100644 index 6d66fcd..0000000 --- a/.history/Makefile_20200511233423 +++ /dev/null @@ -1,22 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233451 b/.history/Makefile_20200511233451 deleted file mode 100644 index 6449a2a..0000000 --- a/.history/Makefile_20200511233451 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233512 b/.history/Makefile_20200511233512 deleted file mode 100644 index 6449a2a..0000000 --- a/.history/Makefile_20200511233512 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -main.o: - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233531 b/.history/Makefile_20200511233531 deleted file mode 100644 index b1b9824..0000000 --- a/.history/Makefile_20200511233531 +++ /dev/null @@ -1,21 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233537 b/.history/Makefile_20200511233537 deleted file mode 100644 index 6697c44..0000000 --- a/.history/Makefile_20200511233537 +++ /dev/null @@ -1,21 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233619 b/.history/Makefile_20200511233619 deleted file mode 100644 index 24dd55f..0000000 --- a/.history/Makefile_20200511233619 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233631 b/.history/Makefile_20200511233631 deleted file mode 100644 index 851129a..0000000 --- a/.history/Makefile_20200511233631 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233633 b/.history/Makefile_20200511233633 deleted file mode 100644 index aa71094..0000000 --- a/.history/Makefile_20200511233633 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233703 b/.history/Makefile_20200511233703 deleted file mode 100644 index 10c1980..0000000 --- a/.history/Makefile_20200511233703 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main.o \ No newline at end of file diff --git a/.history/Makefile_20200511233707 b/.history/Makefile_20200511233707 deleted file mode 100644 index 323bcd3..0000000 --- a/.history/Makefile_20200511233707 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511233714 b/.history/Makefile_20200511233714 deleted file mode 100644 index 323bcd3..0000000 --- a/.history/Makefile_20200511233714 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511233726 b/.history/Makefile_20200511233726 deleted file mode 100644 index 323bcd3..0000000 --- a/.history/Makefile_20200511233726 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: Color.h -Cube.o: Cube.h -main.o: Quad.h -Quad.o: Color.h Vertex.h -Vertex.o: Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511233826 b/.history/Makefile_20200511233826 deleted file mode 100644 index 70744a8..0000000 --- a/.history/Makefile_20200511233826 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511233926 b/.history/Makefile_20200511233926 deleted file mode 100644 index 762598d..0000000 --- a/.history/Makefile_20200511233926 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h ./src/main.cpp -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511233935 b/.history/Makefile_20200511233935 deleted file mode 100644 index 70744a8..0000000 --- a/.history/Makefile_20200511233935 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511233946 b/.history/Makefile_20200511233946 deleted file mode 100644 index b988680..0000000 --- a/.history/Makefile_20200511233946 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234024 b/.history/Makefile_20200511234024 deleted file mode 100644 index d11ab9d..0000000 --- a/.history/Makefile_20200511234024 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234030 b/.history/Makefile_20200511234030 deleted file mode 100644 index d11ab9d..0000000 --- a/.history/Makefile_20200511234030 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234130 b/.history/Makefile_20200511234130 deleted file mode 100644 index b589692..0000000 --- a/.history/Makefile_20200511234130 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := cc $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234218 b/.history/Makefile_20200511234218 deleted file mode 100644 index d11ab9d..0000000 --- a/.history/Makefile_20200511234218 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234223 b/.history/Makefile_20200511234223 deleted file mode 100644 index b988680..0000000 --- a/.history/Makefile_20200511234223 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: ./src/Color.h -Cube.o: ./src/Cube.h -main.o: ./src/Quad.h -Quad.o: ./src/Color.h ./src/Vertex.h -Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234429 b/.history/Makefile_20200511234429 deleted file mode 100644 index 5cba1af..0000000 --- a/.history/Makefile_20200511234429 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -./bin/Color.o: ./src/Color.h -./bin/Cube.o: ./src/Cube.h -./bin/main.o: ./src/Quad.h -./bin/Quad.o: ./src/Color.h ./src/Vertex.h -./bin/Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234457 b/.history/Makefile_20200511234457 deleted file mode 100644 index edef597..0000000 --- a/.history/Makefile_20200511234457 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -bin/Color.o: ./src/Color.h -bin/Cube.o: ./src/Cube.h -bin/main.o: ./src/Quad.h -bin/Quad.o: ./src/Color.h ./src/Vertex.h -bin/Vertex.o: ./src/Vertex.h - -build: $(targets) ; - $(CC) src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234505 b/.history/Makefile_20200511234505 deleted file mode 100644 index c5db739..0000000 --- a/.history/Makefile_20200511234505 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -bin/Color.o: src/Color.h -bin/Cube.o: src/Cube.h -bin/main.o: src/Quad.h -bin/Quad.o: src/Color.h ./src/Vertex.h -bin/Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234522 b/.history/Makefile_20200511234522 deleted file mode 100644 index 86f8ce8..0000000 --- a/.history/Makefile_20200511234522 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o bin/Cube.o bin/main.o bin/Quad.o bin/Vertex.o - -all: build ; - -bin/Color.o: src/Color.h -bin/Cube.o: src/Cube.h -bin/main.o: src/Quad.h -bin/Quad.o: src/Color.h ./src/Vertex.h -bin/Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) src/main.cpp -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234615 b/.history/Makefile_20200511234615 deleted file mode 100644 index d075b1c..0000000 --- a/.history/Makefile_20200511234615 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o bin/Cube.o bin/main.o bin/Quad.o bin/Vertex.o - -all: build ; - -bin/Color.o: src/Color.h -bin/Cube.o: src/Cube.h -bin/main.o: src/Quad.h -bin/Quad.o: src/Color.h ./src/Vertex.h -bin/Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234621 b/.history/Makefile_20200511234621 deleted file mode 100644 index d075b1c..0000000 --- a/.history/Makefile_20200511234621 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o bin/Cube.o bin/main.o bin/Quad.o bin/Vertex.o - -all: build ; - -bin/Color.o: src/Color.h -bin/Cube.o: src/Cube.h -bin/main.o: src/Quad.h -bin/Quad.o: src/Color.h ./src/Vertex.h -bin/Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234639 b/.history/Makefile_20200511234639 deleted file mode 100644 index 98c2355..0000000 --- a/.history/Makefile_20200511234639 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o bin/Cube.o bin/main.o bin/Quad.o bin/Vertex.o - -all: build ; - -bin/Color.o: src/Color.h -bin/Cube.o: src/Cube.h -bin/main.o: src/main.cpp src/Quad.h -bin/Quad.o: src/Color.h ./src/Vertex.h -bin/Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511234646 b/.history/Makefile_20200511234646 deleted file mode 100644 index d075b1c..0000000 --- a/.history/Makefile_20200511234646 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o bin/Cube.o bin/main.o bin/Quad.o bin/Vertex.o - -all: build ; - -bin/Color.o: src/Color.h -bin/Cube.o: src/Cube.h -bin/main.o: src/Quad.h -bin/Quad.o: src/Color.h ./src/Vertex.h -bin/Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235501 b/.history/Makefile_20200511235501 deleted file mode 100644 index cfafe60..0000000 --- a/.history/Makefile_20200511235501 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = bin/Color.o bin/Cube.o bin/main.o bin/Quad.o bin/Vertex.o - -all: build ; - -Color.o: src/Color.h Color.o -Cube.o: src/Cube.h Cube.o -main.o: src/Quad.h main.o -Quad.o: src/Color.h ./src/Vertex.h Quad.o -Vertex.o: src/Vertex.h Vertex.o - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235522 b/.history/Makefile_20200511235522 deleted file mode 100644 index eb0070b..0000000 --- a/.history/Makefile_20200511235522 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h Color.o -Cube.o: src/Cube.h Cube.o -main.o: src/Quad.h main.o -Quad.o: src/Color.h ./src/Vertex.h Quad.o -Vertex.o: src/Vertex.h Vertex.o - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235543 b/.history/Makefile_20200511235543 deleted file mode 100644 index b4c16f6..0000000 --- a/.history/Makefile_20200511235543 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h Color.o -Cube.o: src/Cube.h Cube.o -main.o: src/Quad.h main.o -Quad.o: src/Color.h ./src/Vertex.h Quad.o -Vertex.o: src/Vertex.h ./bin/Vertex.o - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235607 b/.history/Makefile_20200511235607 deleted file mode 100644 index d5436d2..0000000 --- a/.history/Makefile_20200511235607 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235632 b/.history/Makefile_20200511235632 deleted file mode 100644 index d5436d2..0000000 --- a/.history/Makefile_20200511235632 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235725 b/.history/Makefile_20200511235725 deleted file mode 100644 index d5436d2..0000000 --- a/.history/Makefile_20200511235725 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235727 b/.history/Makefile_20200511235727 deleted file mode 100644 index ecd037e..0000000 --- a/.history/Makefile_20200511235727 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235737 b/.history/Makefile_20200511235737 deleted file mode 100644 index 938e9a4..0000000 --- a/.history/Makefile_20200511235737 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200511235920 b/.history/Makefile_20200511235920 deleted file mode 100644 index d16f7c8..0000000 --- a/.history/Makefile_20200511235920 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512000709 b/.history/Makefile_20200512000709 deleted file mode 100644 index 83fe95f..0000000 --- a/.history/Makefile_20200512000709 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512001624 b/.history/Makefile_20200512001624 deleted file mode 100644 index 9c4d281..0000000 --- a/.history/Makefile_20200512001624 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512001633 b/.history/Makefile_20200512001633 deleted file mode 100644 index a9c98dd..0000000 --- a/.history/Makefile_20200512001633 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512001749 b/.history/Makefile_20200512001749 deleted file mode 100644 index 9c4d281..0000000 --- a/.history/Makefile_20200512001749 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -c ./src/main.cpp -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512001840 b/.history/Makefile_20200512001840 deleted file mode 100644 index bce1f6d..0000000 --- a/.history/Makefile_20200512001840 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512001924 b/.history/Makefile_20200512001924 deleted file mode 100644 index a66a4f3..0000000 --- a/.history/Makefile_20200512001924 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512001959 b/.history/Makefile_20200512001959 deleted file mode 100644 index 20556a6..0000000 --- a/.history/Makefile_20200512001959 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002002 b/.history/Makefile_20200512002002 deleted file mode 100644 index 20556a6..0000000 --- a/.history/Makefile_20200512002002 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h -Cube.o: src/Cube.h -main.o: src/Quad.h src/Color.h -Quad.o: src/Color.h -Vertex.o: src/Vertex.h - -build: $(targets) ; - $(CC) -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002353 b/.history/Makefile_20200512002353 deleted file mode 100644 index 83429b4..0000000 --- a/.history/Makefile_20200512002353 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h src/Color.cpp -Cube.o: src/Cube.h src/Cube.cpp -main.o: src/Quad.h src/Color.h src/main.cpp -Quad.o: src/Color.h src/Quad.cpp -Vertex.o: src/Vertex.h Vertex.cpp - -build: $(targets) ; - $(CC) -o ./bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002453 b/.history/Makefile_20200512002453 deleted file mode 100644 index 8951f83..0000000 --- a/.history/Makefile_20200512002453 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h src/Color.cpp -Cube.o: src/Cube.h src/Cube.cpp -main.o: src/Quad.h src/Color.h src/main.cpp -Quad.o: src/Color.h src/Quad.cpp -Vertex.o: src/Vertex.h Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002502 b/.history/Makefile_20200512002502 deleted file mode 100644 index 8951f83..0000000 --- a/.history/Makefile_20200512002502 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h src/Color.cpp -Cube.o: src/Cube.h src/Cube.cpp -main.o: src/Quad.h src/Color.h src/main.cpp -Quad.o: src/Color.h src/Quad.cpp -Vertex.o: src/Vertex.h Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002516 b/.history/Makefile_20200512002516 deleted file mode 100644 index 8951f83..0000000 --- a/.history/Makefile_20200512002516 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h src/Color.cpp -Cube.o: src/Cube.h src/Cube.cpp -main.o: src/Quad.h src/Color.h src/main.cpp -Quad.o: src/Color.h src/Quad.cpp -Vertex.o: src/Vertex.h Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002533 b/.history/Makefile_20200512002533 deleted file mode 100644 index c4ba34a..0000000 --- a/.history/Makefile_20200512002533 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.o Cube.o main.o Quad.o Vertex.o - -all: build ; - -Color.o: src/Color.h src/Color.cpp -Cube.o: src/Cube.h src/Cube.cpp -main.o: src/Quad.h src/Color.h src/main.cpp -Quad.o: src/Color.h src/Quad.cpp -Vertex.o: src/Vertex.h src/Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002632 b/.history/Makefile_20200512002632 deleted file mode 100644 index bd72e92..0000000 --- a/.history/Makefile_20200512002632 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = Color.cpp Cube.cpp main.cpp Quad.cpp Vertex.cpp - -all: build ; - -Color.cpp: src/Color.h src/Color.cpp -Cube.cpp: src/Cube.h src/Cube.cpp -main.cpp: src/Quad.h src/Color.h src/main.cpp -Quad.cpp: src/Color.h src/Quad.cpp -Vertex.cpp: src/Vertex.h src/Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002654 b/.history/Makefile_20200512002654 deleted file mode 100644 index 2821a23..0000000 --- a/.history/Makefile_20200512002654 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -I./src/ -DBG = -Wall -CC := clang $(DBG) - -targets = src/Color.cpp src/Cube.cpp src/main.cpp src/Quad.cpp src/Vertex.cpp - -all: build ; - -Color.cpp: src/Color.h src/Color.cpp -Cube.cpp: src/Cube.h src/Cube.cpp -main.cpp: src/Quad.h src/Color.h src/main.cpp -Quad.cpp: src/Color.h src/Quad.cpp -Vertex.cpp: src/Vertex.h src/Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002708 b/.history/Makefile_20200512002708 deleted file mode 100644 index 6d3f62f..0000000 --- a/.history/Makefile_20200512002708 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = src/Color.cpp src/Cube.cpp src/main.cpp src/Quad.cpp src/Vertex.cpp - -all: build ; - -Color.cpp: src/Color.h src/Color.cpp -Cube.cpp: src/Cube.h src/Cube.cpp -main.cpp: src/Quad.h src/Color.h src/main.cpp -Quad.cpp: src/Color.h src/Quad.cpp -Vertex.cpp: src/Vertex.h src/Vertex.cpp - -build: $(targets) ; - $(CC) -c -o ./bin/main $(targets) $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002742 b/.history/Makefile_20200512002742 deleted file mode 100644 index ec608c2..0000000 --- a/.history/Makefile_20200512002742 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = src/Color.cpp src/Cube.cpp src/main.cpp src/Quad.cpp src/Vertex.cpp - -all: build ; - -Color.cpp: src/Color.h src/Color.cpp -Cube.cpp: src/Cube.h src/Cube.cpp -main.cpp: src/Quad.h src/Color.h src/main.cpp -Quad.cpp: src/Color.h src/Quad.cpp -Vertex.cpp: src/Vertex.h src/Vertex.cpp - -build: $(targets) ; - $(CC) $(targets) -c -o ./bin/main $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512002756 b/.history/Makefile_20200512002756 deleted file mode 100644 index 96a8643..0000000 --- a/.history/Makefile_20200512002756 +++ /dev/null @@ -1,23 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -targets = src/Color.cpp src/Cube.cpp src/main.cpp src/Quad.cpp src/Vertex.cpp - -all: build ; - -Color.cpp: src/Color.h src/Color.cpp -Cube.cpp: src/Cube.h src/Cube.cpp -main.cpp: src/Quad.h src/Color.h src/main.cpp -Quad.cpp: src/Color.h src/Quad.cpp -Vertex.cpp: src/Vertex.h src/Vertex.cpp - -build: $(targets) ; - $(CC) $(targets) -c $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003649 b/.history/Makefile_20200512003649 deleted file mode 100644 index 8880e83..0000000 --- a/.history/Makefile_20200512003649 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) src/main.cpp -o bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003657 b/.history/Makefile_20200512003657 deleted file mode 100644 index 2935f1b..0000000 --- a/.history/Makefile_20200512003657 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/main.cpp -o bin/main.o $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003732 b/.history/Makefile_20200512003732 deleted file mode 100644 index 0f92f73..0000000 --- a/.history/Makefile_20200512003732 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/main.* -o bin/main.o - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003757 b/.history/Makefile_20200512003757 deleted file mode 100644 index 9fe4834..0000000 --- a/.history/Makefile_20200512003757 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/main.* - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003818 b/.history/Makefile_20200512003818 deleted file mode 100644 index 4ca1a6d..0000000 --- a/.history/Makefile_20200512003818 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003822 b/.history/Makefile_20200512003822 deleted file mode 100644 index c0e1479..0000000 --- a/.history/Makefile_20200512003822 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/*.cpp -o bin/ - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003829 b/.history/Makefile_20200512003829 deleted file mode 100644 index 4ca1a6d..0000000 --- a/.history/Makefile_20200512003829 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003842 b/.history/Makefile_20200512003842 deleted file mode 100644 index c8e1dbc..0000000 --- a/.history/Makefile_20200512003842 +++ /dev/null @@ -1,16 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - cd bin/ - $(CC) -c ../src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003911 b/.history/Makefile_20200512003911 deleted file mode 100644 index a416d21..0000000 --- a/.history/Makefile_20200512003911 +++ /dev/null @@ -1,16 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - cd bin/ - $(CC) -c ../src/* - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003927 b/.history/Makefile_20200512003927 deleted file mode 100644 index 87f89e4..0000000 --- a/.history/Makefile_20200512003927 +++ /dev/null @@ -1,16 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - cd bin/ - $(CC) -c src/* - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512003938 b/.history/Makefile_20200512003938 deleted file mode 100644 index 51390b7..0000000 --- a/.history/Makefile_20200512003938 +++ /dev/null @@ -1,16 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - cd bin/ - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512004016 b/.history/Makefile_20200512004016 deleted file mode 100644 index 4ca1a6d..0000000 --- a/.history/Makefile_20200512004016 +++ /dev/null @@ -1,15 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512004205 b/.history/Makefile_20200512004205 deleted file mode 100644 index 86a0d11..0000000 --- a/.history/Makefile_20200512004205 +++ /dev/null @@ -1,16 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -build: $(targets) ; - @cd src/ - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005117 b/.history/Makefile_20200512005117 deleted file mode 100644 index bdc3452..0000000 --- a/.history/Makefile_20200512005117 +++ /dev/null @@ -1,25 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: - -build: $(targets) ; - @cd src/ - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005124 b/.history/Makefile_20200512005124 deleted file mode 100644 index 5e3986e..0000000 --- a/.history/Makefile_20200512005124 +++ /dev/null @@ -1,25 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: $(goals) - -build: $(targets) ; - @cd src/ - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005227 b/.history/Makefile_20200512005227 deleted file mode 100644 index ae181b6..0000000 --- a/.history/Makefile_20200512005227 +++ /dev/null @@ -1,26 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: $(targets) ; - @cd src/ - $(CC) -c src/*.cpp - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005507 b/.history/Makefile_20200512005507 deleted file mode 100644 index 9889c80..0000000 --- a/.history/Makefile_20200512005507 +++ /dev/null @@ -1,25 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: $(targets) ; - bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005538 b/.history/Makefile_20200512005538 deleted file mode 100644 index 152a2d7..0000000 --- a/.history/Makefile_20200512005538 +++ /dev/null @@ -1,25 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: - bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005607 b/.history/Makefile_20200512005607 deleted file mode 100644 index f74ee7a..0000000 --- a/.history/Makefile_20200512005607 +++ /dev/null @@ -1,25 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: - $(CC) $(goals) -o ./bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005648 b/.history/Makefile_20200512005648 deleted file mode 100644 index f74ee7a..0000000 --- a/.history/Makefile_20200512005648 +++ /dev/null @@ -1,25 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp -bin/Cube.o: src/Cube.cpp -bin/Color.o: src/Color.cpp -bin/Quad.o: src/Quad.cpp -bin/Vertex.o: src/Vertex.cpp -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: - $(CC) $(goals) -o ./bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005729 b/.history/Makefile_20200512005729 deleted file mode 100644 index f10b98c..0000000 --- a/.history/Makefile_20200512005729 +++ /dev/null @@ -1,30 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) $^ -o $@ -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: - $(CC) $(goals) -o ./bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005741 b/.history/Makefile_20200512005741 deleted file mode 100644 index 218a211..0000000 --- a/.history/Makefile_20200512005741 +++ /dev/null @@ -1,30 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) $^ -o $@ -bin/simulator: $(goals) ; - $(CC) $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005803 b/.history/Makefile_20200512005803 deleted file mode 100644 index 63e86c7..0000000 --- a/.history/Makefile_20200512005803 +++ /dev/null @@ -1,30 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ -bin/simulator: $(goals) ; - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005826 b/.history/Makefile_20200512005826 deleted file mode 100644 index 2adf4de..0000000 --- a/.history/Makefile_20200512005826 +++ /dev/null @@ -1,30 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ -bin/simulator: $(goals) ; - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005851 b/.history/Makefile_20200512005851 deleted file mode 100644 index 1eca7e6..0000000 --- a/.history/Makefile_20200512005851 +++ /dev/null @@ -1,28 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005925 b/.history/Makefile_20200512005925 deleted file mode 100644 index 6d5d3f8..0000000 --- a/.history/Makefile_20200512005925 +++ /dev/null @@ -1,29 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -.PHONY run -run: build ; - ./bin/main \ No newline at end of file diff --git a/.history/Makefile_20200512005944 b/.history/Makefile_20200512005944 deleted file mode 100644 index 65dd269..0000000 --- a/.history/Makefile_20200512005944 +++ /dev/null @@ -1,29 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -.PHONY run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512010012 b/.history/Makefile_20200512010012 deleted file mode 100644 index 94723e4..0000000 --- a/.history/Makefile_20200512010012 +++ /dev/null @@ -1,29 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: main.o ; - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512095009 b/.history/Makefile_20200512095009 deleted file mode 100644 index 69ba4b4..0000000 --- a/.history/Makefile_20200512095009 +++ /dev/null @@ -1,29 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512095614 b/.history/Makefile_20200512095614 deleted file mode 100644 index 69ba4b4..0000000 --- a/.history/Makefile_20200512095614 +++ /dev/null @@ -1,29 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512095616 b/.history/Makefile_20200512095616 deleted file mode 100644 index 69ba4b4..0000000 --- a/.history/Makefile_20200512095616 +++ /dev/null @@ -1,29 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -bin/main.o: src/main.cpp - $(CC) -c $^ -o $@ -bin/Cube.o: src/Cube.cpp - $(CC) -c $^ -o $@ -bin/Color.o: src/Color.cpp - $(CC) -c $^ -o $@ -bin/Quad.o: src/Quad.cpp - $(CC) -c $^ -o $@ -bin/Vertex.o: src/Vertex.cpp - $(CC) -c $^ -o $@ - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512113711 b/.history/Makefile_20200512113711 deleted file mode 100644 index cff1683..0000000 --- a/.history/Makefile_20200512113711 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122020 b/.history/Makefile_20200512122020 deleted file mode 100644 index 12c3215..0000000 --- a/.history/Makefile_20200512122020 +++ /dev/null @@ -1,34 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -echo $% -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122058 b/.history/Makefile_20200512122058 deleted file mode 100644 index 2fb661d..0000000 --- a/.history/Makefile_20200512122058 +++ /dev/null @@ -1,34 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -echo $% -endef - -bin/main.o: src/main.cpp src/Quad.h - $(pro) -bin/Cube.o: src/Cube.cpp src/Cube.h - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122134 b/.history/Makefile_20200512122134 deleted file mode 100644 index 12c3215..0000000 --- a/.history/Makefile_20200512122134 +++ /dev/null @@ -1,34 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -echo $% -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122202 b/.history/Makefile_20200512122202 deleted file mode 100644 index cff1683..0000000 --- a/.history/Makefile_20200512122202 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122220 b/.history/Makefile_20200512122220 deleted file mode 100644 index d4799cd..0000000 --- a/.history/Makefile_20200512122220 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: %o : %cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122241 b/.history/Makefile_20200512122241 deleted file mode 100644 index 717ecc4..0000000 --- a/.history/Makefile_20200512122241 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: %o : src/%cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122259 b/.history/Makefile_20200512122259 deleted file mode 100644 index af85ee1..0000000 --- a/.history/Makefile_20200512122259 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: %o : ../src/%cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122307 b/.history/Makefile_20200512122307 deleted file mode 100644 index d4799cd..0000000 --- a/.history/Makefile_20200512122307 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: %o : %cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122440 b/.history/Makefile_20200512122440 deleted file mode 100644 index d4799cd..0000000 --- a/.history/Makefile_20200512122440 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: %o : %cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122803 b/.history/Makefile_20200512122803 deleted file mode 100644 index b39e781..0000000 --- a/.history/Makefile_20200512122803 +++ /dev/null @@ -1,34 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -echo $* -endef - -bin/main.o: %o : %cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122821 b/.history/Makefile_20200512122821 deleted file mode 100644 index c7c9890..0000000 --- a/.history/Makefile_20200512122821 +++ /dev/null @@ -1,34 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -echo $* -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512122910 b/.history/Makefile_20200512122910 deleted file mode 100644 index cff1683..0000000 --- a/.history/Makefile_20200512122910 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512145408 b/.history/Makefile_20200512145408 deleted file mode 100644 index 491201b..0000000 --- a/.history/Makefile_20200512145408 +++ /dev/null @@ -1,34 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -build: $(goals) ; - for goal in $(goals) do - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512145509 b/.history/Makefile_20200512145509 deleted file mode 100644 index f2a64b7..0000000 --- a/.history/Makefile_20200512145509 +++ /dev/null @@ -1,36 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -build: $(goals) ; - for goal in $(goals) ; do\ - echo $$goal ; \ - done - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512145543 b/.history/Makefile_20200512145543 deleted file mode 100644 index 5386e38..0000000 --- a/.history/Makefile_20200512145543 +++ /dev/null @@ -1,36 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -build: $(goals) ; - for goal in $(goals) ; do\ - $(pro) $$goal ; \ - done - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512145729 b/.history/Makefile_20200512145729 deleted file mode 100644 index cff1683..0000000 --- a/.history/Makefile_20200512145729 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200512145745 b/.history/Makefile_20200512145745 deleted file mode 100644 index cff1683..0000000 --- a/.history/Makefile_20200512145745 +++ /dev/null @@ -1,33 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513122930 b/.history/Makefile_20200513122930 deleted file mode 100644 index 5508590..0000000 --- a/.history/Makefile_20200513122930 +++ /dev/null @@ -1,37 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -bin/Cube.o: src/Cube.cpp - $(pro) -bin/Color.o: src/Color.cpp - $(pro) -bin/Quad.o: src/Quad.cpp - $(pro) -bin/Vertex.o: src/Vertex.cpp - $(pro) - -$(goals): %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513122959 b/.history/Makefile_20200513122959 deleted file mode 100644 index 7f9c690..0000000 --- a/.history/Makefile_20200513122959 +++ /dev/null @@ -1,37 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123017 b/.history/Makefile_20200513123017 deleted file mode 100644 index db34590..0000000 --- a/.history/Makefile_20200513123017 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123140 b/.history/Makefile_20200513123140 deleted file mode 100644 index 8f95f95..0000000 --- a/.history/Makefile_20200513123140 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %bin/ : %src/ : %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123200 b/.history/Makefile_20200513123200 deleted file mode 100644 index 3824998..0000000 --- a/.history/Makefile_20200513123200 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %bin/ : %src/ %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123243 b/.history/Makefile_20200513123243 deleted file mode 100644 index 102cb82..0000000 --- a/.history/Makefile_20200513123243 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): bin/%.o : src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123410 b/.history/Makefile_20200513123410 deleted file mode 100644 index 01ede3c..0000000 --- a/.history/Makefile_20200513123410 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$goals: bin/%.o : src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123423 b/.history/Makefile_20200513123423 deleted file mode 100644 index 102cb82..0000000 --- a/.history/Makefile_20200513123423 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): bin/%.o : src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123433 b/.history/Makefile_20200513123433 deleted file mode 100644 index 3e3a18b..0000000 --- a/.history/Makefile_20200513123433 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp -# $(pro) -bin/Cube.o: src/Cube.cpp -# $(pro) -bin/Color.o: src/Color.cpp -# $(pro) -bin/Quad.o: src/Quad.cpp -# $(pro) -bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): bin/%.o : src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123441 b/.history/Makefile_20200513123441 deleted file mode 100644 index 102cb82..0000000 --- a/.history/Makefile_20200513123441 +++ /dev/null @@ -1,38 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): bin/%.o : src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123514 b/.history/Makefile_20200513123514 deleted file mode 100644 index 0f38f32..0000000 --- a/.history/Makefile_20200513123514 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): bin/%.o : src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123603 b/.history/Makefile_20200513123603 deleted file mode 100644 index a6465a8..0000000 --- a/.history/Makefile_20200513123603 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123629 b/.history/Makefile_20200513123629 deleted file mode 100644 index a6465a8..0000000 --- a/.history/Makefile_20200513123629 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o : %.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123759 b/.history/Makefile_20200513123759 deleted file mode 100644 index 5f973ac..0000000 --- a/.history/Makefile_20200513123759 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o:%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123840 b/.history/Makefile_20200513123840 deleted file mode 100644 index 864dceb..0000000 --- a/.history/Makefile_20200513123840 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): bin/%.o:src/%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: src/%.o : src/%.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123854 b/.history/Makefile_20200513123854 deleted file mode 100644 index 0450088..0000000 --- a/.history/Makefile_20200513123854 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o:%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: src/%.o : src/%.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513123905 b/.history/Makefile_20200513123905 deleted file mode 100644 index 0450088..0000000 --- a/.history/Makefile_20200513123905 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o:%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: src/%.o : src/%.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124216 b/.history/Makefile_20200513124216 deleted file mode 100644 index 5f973ac..0000000 --- a/.history/Makefile_20200513124216 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): %.o:%.cpp - for goal in $(goals) ; do\ - $(CC) $($$goal: %.o : %.cpp) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124320 b/.history/Makefile_20200513124320 deleted file mode 100644 index 7ba8f22..0000000 --- a/.history/Makefile_20200513124320 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) - -$(goals): $(substr bin/,src/,%.o:%.cpp) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124438 b/.history/Makefile_20200513124438 deleted file mode 100644 index 072cddb..0000000 --- a/.history/Makefile_20200513124438 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/*.o,src/*.cpp,$(goals)) -$(goals): $(substr bin/,src/,%.o:%.cpp) - - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124541 b/.history/Makefile_20200513124541 deleted file mode 100644 index 73e5635..0000000 --- a/.history/Makefile_20200513124541 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/*.o,src/*.cpp,$(goals)) -$(goals): $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124558 b/.history/Makefile_20200513124558 deleted file mode 100644 index 73e5635..0000000 --- a/.history/Makefile_20200513124558 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/*.o,src/*.cpp,$(goals)) -$(goals): $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124608 b/.history/Makefile_20200513124608 deleted file mode 100644 index f802d81..0000000 --- a/.history/Makefile_20200513124608 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/*.o,src/*.cpp,$(goals)) -$(goals): $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $(goal) ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513124624 b/.history/Makefile_20200513124624 deleted file mode 100644 index 73e5635..0000000 --- a/.history/Makefile_20200513124624 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/*.o,src/*.cpp,$(goals)) -$(goals): $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125013 b/.history/Makefile_20200513125013 deleted file mode 100644 index 004bff5..0000000 --- a/.history/Makefile_20200513125013 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/*.o,src/*.cpp,$(goals)) -$(goals): $(targets) - echo $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125052 b/.history/Makefile_20200513125052 deleted file mode 100644 index a5fdab0..0000000 --- a/.history/Makefile_20200513125052 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(substr bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - echo $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125126 b/.history/Makefile_20200513125126 deleted file mode 100644 index fc8497c..0000000 --- a/.history/Makefile_20200513125126 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - echo $(targets) - for goal in $(goals) ; do\ - $(CC) $(subst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125143 b/.history/Makefile_20200513125143 deleted file mode 100644 index cd5de7f..0000000 --- a/.history/Makefile_20200513125143 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - echo $(targets) - for goal in $(goals) ; do\ - $(CC) $(patsubst bin/,src/,$($$goal: %.o : %.cpp)) $$goal ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125206 b/.history/Makefile_20200513125206 deleted file mode 100644 index 18fd37c..0000000 --- a/.history/Makefile_20200513125206 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - echo $(targets) - for goal in $(goals) ; do\ - $(CC) $(patsubst bin/%.o,src/%.cpp,$$goal) ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125218 b/.history/Makefile_20200513125218 deleted file mode 100644 index 0e0e951..0000000 --- a/.history/Makefile_20200513125218 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - for goal in $(goals) ; do\ - $(CC) $(patsubst bin/%.o,src/%.cpp,$$goal) ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513125946 b/.history/Makefile_20200513125946 deleted file mode 100644 index 637b92f..0000000 --- a/.history/Makefile_20200513125946 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$($(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)))) - for goal in $(goals) ; do\ - $(CC) $(patsubst bin/%.o,src/%.cpp,$$goal) ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130104 b/.history/Makefile_20200513130104 deleted file mode 100644 index a5dd87b..0000000 --- a/.history/Makefile_20200513130104 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - ) - for goal in $(goals) ; do\ - $(CC) $(patsubst bin/%.o,src/%.cpp,$$goal) ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130117 b/.history/Makefile_20200513130117 deleted file mode 100644 index 61e736b..0000000 --- a/.history/Makefile_20200513130117 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - )) - for goal in $(goals) ; do\ - $(CC) $(patsubst bin/%.o,src/%.cpp,$$goal) ; \ - done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130353 b/.history/Makefile_20200513130353 deleted file mode 100644 index 18fd13d..0000000 --- a/.history/Makefile_20200513130353 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - )) - #for goal in $(goals) ; do\ - # $(CC) $(patsubst bin/%.o,src/%.cpp,$$goal) ; \ - #done - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130432 b/.history/Makefile_20200513130432 deleted file mode 100644 index 14c45bb..0000000 --- a/.history/Makefile_20200513130432 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130456 b/.history/Makefile_20200513130456 deleted file mode 100644 index cc958f4..0000000 --- a/.history/Makefile_20200513130456 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130508 b/.history/Makefile_20200513130508 deleted file mode 100644 index 7ce87e3..0000000 --- a/.history/Makefile_20200513130508 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130809 b/.history/Makefile_20200513130809 deleted file mode 100644 index 7ce87e3..0000000 --- a/.history/Makefile_20200513130809 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130839 b/.history/Makefile_20200513130839 deleted file mode 100644 index e50c590..0000000 --- a/.history/Makefile_20200513130839 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - goals - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130844 b/.history/Makefile_20200513130844 deleted file mode 100644 index 59b7a95..0000000 --- a/.history/Makefile_20200513130844 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130854 b/.history/Makefile_20200513130854 deleted file mode 100644 index 6ebe964..0000000 --- a/.history/Makefile_20200513130854 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(clean) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130906 b/.history/Makefile_20200513130906 deleted file mode 100644 index 59b7a95..0000000 --- a/.history/Makefile_20200513130906 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130915 b/.history/Makefile_20200513130915 deleted file mode 100644 index 7ce87e3..0000000 --- a/.history/Makefile_20200513130915 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513130933 b/.history/Makefile_20200513130933 deleted file mode 100644 index 975169e..0000000 --- a/.history/Makefile_20200513130933 +++ /dev/null @@ -1,41 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - echo $(goals) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131004 b/.history/Makefile_20200513131004 deleted file mode 100644 index d668d20..0000000 --- a/.history/Makefile_20200513131004 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - echo $(goals) - $(goals) - echo $(patsubst bin/%.o,src/%.cpp,$(goals)) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131017 b/.history/Makefile_20200513131017 deleted file mode 100644 index a81b791..0000000 --- a/.history/Makefile_20200513131017 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - echo $(goals) - echo $(patsubst bin/%.o,src/%.cpp,$(goals)) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131041 b/.history/Makefile_20200513131041 deleted file mode 100644 index 7ce87e3..0000000 --- a/.history/Makefile_20200513131041 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131048 b/.history/Makefile_20200513131048 deleted file mode 100644 index 3dec8a8..0000000 --- a/.history/Makefile_20200513131048 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131123 b/.history/Makefile_20200513131123 deleted file mode 100644 index a01e1c1..0000000 --- a/.history/Makefile_20200513131123 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131132 b/.history/Makefile_20200513131132 deleted file mode 100644 index d31c481..0000000 --- a/.history/Makefile_20200513131132 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -bin/main.o: src/main.cpp - $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131146 b/.history/Makefile_20200513131146 deleted file mode 100644 index 3dec8a8..0000000 --- a/.history/Makefile_20200513131146 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(goals) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131336 b/.history/Makefile_20200513131336 deleted file mode 100644 index 41bcb85..0000000 --- a/.history/Makefile_20200513131336 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131344 b/.history/Makefile_20200513131344 deleted file mode 100644 index 41bcb85..0000000 --- a/.history/Makefile_20200513131344 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(goals) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131602 b/.history/Makefile_20200513131602 deleted file mode 100644 index 2d30709..0000000 --- a/.history/Makefile_20200513131602 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(foreach goal,$(goals),$( \ - $(goal)\ - )) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131621 b/.history/Makefile_20200513131621 deleted file mode 100644 index 2d30709..0000000 --- a/.history/Makefile_20200513131621 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(foreach goal,$(goals),$( \ - $(goal)\ - )) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131845 b/.history/Makefile_20200513131845 deleted file mode 100644 index feb5f7d..0000000 --- a/.history/Makefile_20200513131845 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - #$(CC) $(goals) -o ./bin/simulator $(LINK) - $(foreach goal,$(goals),$( \ - $(goal)\ - )) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513131940 b/.history/Makefile_20200513131940 deleted file mode 100644 index 8c5a4a8..0000000 --- a/.history/Makefile_20200513131940 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - $(foreach goal,$(goals),$( \ - $(goal)\ - )) - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513132006 b/.history/Makefile_20200513132006 deleted file mode 100644 index e027fa5..0000000 --- a/.history/Makefile_20200513132006 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $($(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - ))) - -build: $(targets) ; - $(foreach goal,$(goals),$( \ - $(goal)\ - )) - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513132016 b/.history/Makefile_20200513132016 deleted file mode 100644 index 8c5a4a8..0000000 --- a/.history/Makefile_20200513132016 +++ /dev/null @@ -1,42 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - $(foreach goal,$(goals),$( \ - $(goal)\ - )) - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513132905 b/.history/Makefile_20200513132905 deleted file mode 100644 index af04727..0000000 --- a/.history/Makefile_20200513132905 +++ /dev/null @@ -1,39 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - $(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513132931 b/.history/Makefile_20200513132931 deleted file mode 100644 index 8e45d3b..0000000 --- a/.history/Makefile_20200513132931 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - $(GOALS) - #$(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513132942 b/.history/Makefile_20200513132942 deleted file mode 100644 index 9a01692..0000000 --- a/.history/Makefile_20200513132942 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - $(goals) - #$(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513134126 b/.history/Makefile_20200513134126 deleted file mode 100644 index d373bdd..0000000 --- a/.history/Makefile_20200513134126 +++ /dev/null @@ -1,40 +0,0 @@ -LINK = -lstdc++ -lSDL2 -lOpenGL -lGLEW -lGLU -DBG = -Wall -CC := clang $(DBG) -c - -all: build ; - -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o - -define pro = -$(CC) -c $^ -o $@ -endef - -#bin/main.o: src/main.cpp -# $(pro) -#bin/Cube.o: src/Cube.cpp -# $(pro) -#bin/Color.o: src/Color.cpp -# $(pro) -#bin/Quad.o: src/Quad.cpp -# $(pro) -#bin/Vertex.o: src/Vertex.cpp -# $(pro) -targets = $(patsubst bin/%.o,src/%.cpp,$(goals)) -$(goals): $(targets) ; - $(foreach goal,$(goals),$( \ - $(CC) $(patsubst bin/%.o, src/%.cpp, $(goal)) \ - echo $(goal) \ - )) - -build: $(targets) ; - - #$(CC) $(goals) -o ./bin/simulator $(LINK) - -.PHONY: clean -clean: - rm -rf ./bin/* - -.PHONY: run -run: build ; - ./bin/simulator \ No newline at end of file diff --git a/.history/Makefile_20200513134548 b/.history/Makefile_20200513134548 deleted file mode 100644 index 349fd69..0000000 --- a/.history/Makefile_20200513134548 +++ /dev/null @@ -1 +0,0 @@ -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o diff --git a/.history/Makefile_20200513135257 b/.history/Makefile_20200513135257 deleted file mode 100644 index aeb088a..0000000 --- a/.history/Makefile_20200513135257 +++ /dev/null @@ -1,4 +0,0 @@ -goals = bin/main.o bin/Cube.o bin/Color.o bin/Quad.o bin/Vertex.o -targets = $(patsubst bin/%.o, src/%.cpp, $(goals)) - -$(goals): $(targets) ; diff --git a/.history/generatecube_20200511164401.lua b/.history/generatecube_20200511164401.lua deleted file mode 100644 index e69de29..0000000 diff --git a/.history/generatecube_20200511171029.lua b/.history/generatecube_20200511171029.lua deleted file mode 100644 index cd2fe53..0000000 --- a/.history/generatecube_20200511171029.lua +++ /dev/null @@ -1,2 +0,0 @@ -local file = io.open("vertexes.txt", "w+") - diff --git a/.history/src/Color_20200511171542.h b/.history/src/Color_20200511171542.h deleted file mode 100644 index fce2787..0000000 --- a/.history/src/Color_20200511171542.h +++ /dev/null @@ -1,10 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511175158.h b/.history/src/Color_20200511175158.h deleted file mode 100644 index fce2787..0000000 --- a/.history/src/Color_20200511175158.h +++ /dev/null @@ -1,10 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511175840.h b/.history/src/Color_20200511175840.h deleted file mode 100644 index ae208a4..0000000 --- a/.history/src/Color_20200511175840.h +++ /dev/null @@ -1,16 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color() { - this->r=1.0f - this->g=1.0f; - this->b=1.0f; - this->a=1.0f; - } - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511175845.h b/.history/src/Color_20200511175845.h deleted file mode 100644 index 0bb5fc5..0000000 --- a/.history/src/Color_20200511175845.h +++ /dev/null @@ -1,16 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color() { - this->r=1.0f; - this->g=1.0f; - this->b=1.0f; - this->a=1.0f; - } - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511175902.h b/.history/src/Color_20200511175902.h deleted file mode 100644 index 0bb5fc5..0000000 --- a/.history/src/Color_20200511175902.h +++ /dev/null @@ -1,16 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color() { - this->r=1.0f; - this->g=1.0f; - this->b=1.0f; - this->a=1.0f; - } - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511180426.h b/.history/src/Color_20200511180426.h deleted file mode 100644 index e8cd044..0000000 --- a/.history/src/Color_20200511180426.h +++ /dev/null @@ -1,19 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(); - /* - Color() { - this->r=1.0f; - this->g=1.0f; - this->b=1.0f; - this->a=1.0f; - } - */ - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511180509.h b/.history/src/Color_20200511180509.h deleted file mode 100644 index e8788ff..0000000 --- a/.history/src/Color_20200511180509.h +++ /dev/null @@ -1,11 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511184059.h b/.history/src/Color_20200511184059.h deleted file mode 100644 index e8788ff..0000000 --- a/.history/src/Color_20200511184059.h +++ /dev/null @@ -1,11 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511184834.h b/.history/src/Color_20200511184834.h deleted file mode 100644 index 3a4f456..0000000 --- a/.history/src/Color_20200511184834.h +++ /dev/null @@ -1,11 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511184840.h b/.history/src/Color_20200511184840.h deleted file mode 100644 index 3a4f456..0000000 --- a/.history/src/Color_20200511184840.h +++ /dev/null @@ -1,11 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511185132.h b/.history/src/Color_20200511185132.h deleted file mode 100644 index e8788ff..0000000 --- a/.history/src/Color_20200511185132.h +++ /dev/null @@ -1,11 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511195616.h b/.history/src/Color_20200511195616.h deleted file mode 100644 index 7b9007c..0000000 --- a/.history/src/Color_20200511195616.h +++ /dev/null @@ -1,16 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511214107.cpp b/.history/src/Color_20200511214107.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Color_20200511214344.cpp b/.history/src/Color_20200511214344.cpp deleted file mode 100644 index 5728138..0000000 --- a/.history/src/Color_20200511214344.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "Color.h" \ No newline at end of file diff --git a/.history/src/Color_20200511214346.cpp b/.history/src/Color_20200511214346.cpp deleted file mode 100644 index b511054..0000000 --- a/.history/src/Color_20200511214346.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Color.h" - -Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } \ No newline at end of file diff --git a/.history/src/Color_20200511214352.cpp b/.history/src/Color_20200511214352.cpp deleted file mode 100644 index cc8d188..0000000 --- a/.history/src/Color_20200511214352.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } \ No newline at end of file diff --git a/.history/src/Color_20200511214540.h b/.history/src/Color_20200511214540.h deleted file mode 100644 index 984cdbf..0000000 --- a/.history/src/Color_20200511214540.h +++ /dev/null @@ -1,10 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); -}; \ No newline at end of file diff --git a/.history/src/Color_20200511214543.cpp b/.history/src/Color_20200511214543.cpp deleted file mode 100644 index cc8d188..0000000 --- a/.history/src/Color_20200511214543.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } \ No newline at end of file diff --git a/.history/src/Color_20200511214549.cpp b/.history/src/Color_20200511214549.cpp deleted file mode 100644 index 5728138..0000000 --- a/.history/src/Color_20200511214549.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "Color.h" \ No newline at end of file diff --git a/.history/src/Color_20200511214553.h b/.history/src/Color_20200511214553.h deleted file mode 100644 index 8003fe5..0000000 --- a/.history/src/Color_20200511214553.h +++ /dev/null @@ -1,16 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); - Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511214556.h b/.history/src/Color_20200511214556.h deleted file mode 100644 index 8003fe5..0000000 --- a/.history/src/Color_20200511214556.h +++ /dev/null @@ -1,16 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); - Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511214607.h b/.history/src/Color_20200511214607.h deleted file mode 100644 index 7b9007c..0000000 --- a/.history/src/Color_20200511214607.h +++ /dev/null @@ -1,16 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/Color_20200511214903.h b/.history/src/Color_20200511214903.h deleted file mode 100644 index 0e6ca6d..0000000 --- a/.history/src/Color_20200511214903.h +++ /dev/null @@ -1,11 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a); -}; \ No newline at end of file diff --git a/.history/src/Color_20200511214929.cpp b/.history/src/Color_20200511214929.cpp deleted file mode 100644 index f8df347..0000000 --- a/.history/src/Color_20200511214929.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Color.h" - - Color::Color(float r,float g,float b,float a){ - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } \ No newline at end of file diff --git a/.history/src/Color_20200511215000.cpp b/.history/src/Color_20200511215000.cpp deleted file mode 100644 index 9ec2c59..0000000 --- a/.history/src/Color_20200511215000.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a){ - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} diff --git a/.history/src/Color_20200511215006.cpp b/.history/src/Color_20200511215006.cpp deleted file mode 100644 index fc9c45b..0000000 --- a/.history/src/Color_20200511215006.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} diff --git a/.history/src/Color_20200511215017.cpp b/.history/src/Color_20200511215017.cpp deleted file mode 100644 index 0dcd545..0000000 --- a/.history/src/Color_20200511215017.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} -Color::Color(); \ No newline at end of file diff --git a/.history/src/Color_20200511215019.cpp b/.history/src/Color_20200511215019.cpp deleted file mode 100644 index ecc8c21..0000000 --- a/.history/src/Color_20200511215019.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} -Color::Color() {}; \ No newline at end of file diff --git a/.history/src/Color_20200511215026.cpp b/.history/src/Color_20200511215026.cpp deleted file mode 100644 index cb4a345..0000000 --- a/.history/src/Color_20200511215026.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} -Color::Color() {} \ No newline at end of file diff --git a/.history/src/Color_20200511215048.cpp b/.history/src/Color_20200511215048.cpp deleted file mode 100644 index cb4a345..0000000 --- a/.history/src/Color_20200511215048.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Color.h" - -Color::Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} -Color::Color() {} \ No newline at end of file diff --git a/.history/src/Color_20200512000019.h b/.history/src/Color_20200512000019.h deleted file mode 100644 index 0e6ca6d..0000000 --- a/.history/src/Color_20200512000019.h +++ /dev/null @@ -1,11 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class Color { - public: - float r,g,b,a; - Color(); - Color(float r,float g,float b,float a); -}; \ No newline at end of file diff --git a/.history/src/Color_20200512000031.h b/.history/src/Color_20200512000031.h deleted file mode 100644 index e00c46b..0000000 --- a/.history/src/Color_20200512000031.h +++ /dev/null @@ -1,11 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f - -class myColor { - public: - float r,g,b,a; - myColor(); - myColor(float r,float g,float b,float a); -}; \ No newline at end of file diff --git a/.history/src/Color_20200512000048.cpp b/.history/src/Color_20200512000048.cpp deleted file mode 100644 index b4b3a3c..0000000 --- a/.history/src/Color_20200512000048.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Color.h" - -myColor::myColor(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; -} -myColor::myColor() {} \ No newline at end of file diff --git a/.history/src/Color_20200512011729.h b/.history/src/Color_20200512011729.h deleted file mode 100644 index 3c755da..0000000 --- a/.history/src/Color_20200512011729.h +++ /dev/null @@ -1,13 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f -#define WHITE_f4 1.0f,1.0f,1.0f,1.0f -#define BLACK_f4 0.0f,0.0f,0.0f,1.0f; - -class myColor { - public: - float r,g,b,a; - myColor(); - myColor(float r,float g,float b,float a); -}; \ No newline at end of file diff --git a/.history/src/Color_20200512011730.h b/.history/src/Color_20200512011730.h deleted file mode 100644 index 481db58..0000000 --- a/.history/src/Color_20200512011730.h +++ /dev/null @@ -1,13 +0,0 @@ -#define RED_f4 1.0f,0.0f,0.0f,1.0f -#define GREEN_f4 0.0f,1.0f,0.0f,1.0f -#define BLUE_f4 0.0f,0.0f,1.0f,1.0f -#define PURPLE_f4 1.0f,0.0f,1.0f,1.0f -#define WHITE_f4 1.0f,1.0f,1.0f,1.0f -#define BLACK_f4 0.0f,0.0f,0.0f,1.0f - -class myColor { - public: - float r,g,b,a; - myColor(); - myColor(float r,float g,float b,float a); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511182530.h b/.history/src/Cube_20200511182530.h deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Cube_20200511182542.h b/.history/src/Cube_20200511182542.h deleted file mode 100644 index 377b8ae..0000000 --- a/.history/src/Cube_20200511182542.h +++ /dev/null @@ -1 +0,0 @@ -#include \ No newline at end of file diff --git a/.history/src/Cube_20200511183329.h b/.history/src/Cube_20200511183329.h deleted file mode 100644 index 3a26f7e..0000000 --- a/.history/src/Cube_20200511183329.h +++ /dev/null @@ -1,6 +0,0 @@ -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511183343.h b/.history/src/Cube_20200511183343.h deleted file mode 100644 index 5271b97..0000000 --- a/.history/src/Cube_20200511183343.h +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511183548.h b/.history/src/Cube_20200511183548.h deleted file mode 100644 index 2230b28..0000000 --- a/.history/src/Cube_20200511183548.h +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184002.h b/.history/src/Cube_20200511184002.h deleted file mode 100644 index 5a1774b..0000000 --- a/.history/src/Cube_20200511184002.h +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184009.h b/.history/src/Cube_20200511184009.h deleted file mode 100644 index 5a1774b..0000000 --- a/.history/src/Cube_20200511184009.h +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184116.h b/.history/src/Cube_20200511184116.h deleted file mode 100644 index 5a1774b..0000000 --- a/.history/src/Cube_20200511184116.h +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184202.h b/.history/src/Cube_20200511184202.h deleted file mode 100644 index 5119227..0000000 --- a/.history/src/Cube_20200511184202.h +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184203.h b/.history/src/Cube_20200511184203.h deleted file mode 100644 index 5119227..0000000 --- a/.history/src/Cube_20200511184203.h +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184209.h b/.history/src/Cube_20200511184209.h deleted file mode 100644 index 34fd9c3..0000000 --- a/.history/src/Cube_20200511184209.h +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube( - Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184212.h b/.history/src/Cube_20200511184212.h deleted file mode 100644 index 5119227..0000000 --- a/.history/src/Cube_20200511184212.h +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184523.h b/.history/src/Cube_20200511184523.h deleted file mode 100644 index 989e03d..0000000 --- a/.history/src/Cube_20200511184523.h +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184555.h b/.history/src/Cube_20200511184555.h deleted file mode 100644 index 7670012..0000000 --- a/.history/src/Cube_20200511184555.h +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; - } -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511184633.h b/.history/src/Cube_20200511184633.h deleted file mode 100644 index 8da9bd4..0000000 --- a/.history/src/Cube_20200511184633.h +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; - } -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511184644.h b/.history/src/Cube_20200511184644.h deleted file mode 100644 index 52e18d9..0000000 --- a/.history/src/Cube_20200511184644.h +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; - } - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511185025.h b/.history/src/Cube_20200511185025.h deleted file mode 100644 index 083f08f..0000000 --- a/.history/src/Cube_20200511185025.h +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; - } - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511200128.h b/.history/src/Cube_20200511200128.h deleted file mode 100644 index 9b3bced..0000000 --- a/.history/src/Cube_20200511200128.h +++ /dev/null @@ -1,46 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; - } - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; - } - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215053.cpp b/.history/src/Cube_20200511215053.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Cube_20200511215349.cpp b/.history/src/Cube_20200511215349.cpp deleted file mode 100644 index c10fb9b..0000000 --- a/.history/src/Cube_20200511215349.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "Cube.h" - -Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215400.cpp b/.history/src/Cube_20200511215400.cpp deleted file mode 100644 index aeadd99..0000000 --- a/.history/src/Cube_20200511215400.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215430.cpp b/.history/src/Cube_20200511215430.cpp deleted file mode 100644 index 0af8299..0000000 --- a/.history/src/Cube_20200511215430.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215539.cpp b/.history/src/Cube_20200511215539.cpp deleted file mode 100644 index 87f5078..0000000 --- a/.history/src/Cube_20200511215539.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} -Cube::Cube( - Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back -) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215544.cpp b/.history/src/Cube_20200511215544.cpp deleted file mode 100644 index 87f5078..0000000 --- a/.history/src/Cube_20200511215544.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} -Cube::Cube( - Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back -) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215553.h b/.history/src/Cube_20200511215553.h deleted file mode 100644 index e66583c..0000000 --- a/.history/src/Cube_20200511215553.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215555.h b/.history/src/Cube_20200511215555.h deleted file mode 100644 index 62bc434..0000000 --- a/.history/src/Cube_20200511215555.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215557.h b/.history/src/Cube_20200511215557.h deleted file mode 100644 index 62bc434..0000000 --- a/.history/src/Cube_20200511215557.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215604.h b/.history/src/Cube_20200511215604.h deleted file mode 100644 index e66583c..0000000 --- a/.history/src/Cube_20200511215604.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ) - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ) - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215610.h b/.history/src/Cube_20200511215610.h deleted file mode 100644 index 2583ccb..0000000 --- a/.history/src/Cube_20200511215610.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(); -}; - -void Cube::setColor() { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215619.h b/.history/src/Cube_20200511215619.h deleted file mode 100644 index 5ae6ad8..0000000 --- a/.history/src/Cube_20200511215619.h +++ /dev/null @@ -1,26 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511215638.cpp b/.history/src/Cube_20200511215638.cpp deleted file mode 100644 index f635b00..0000000 --- a/.history/src/Cube_20200511215638.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} - -Cube::Cube( - Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back -) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; -} - -void Cube::setColor(Color c) { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215641.cpp b/.history/src/Cube_20200511215641.cpp deleted file mode 100644 index 1cb7319..0000000 --- a/.history/src/Cube_20200511215641.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} - -Cube::Cube( - Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back -) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; -} - -void Cube::setColor(Color c) { - -} \ No newline at end of file diff --git a/.history/src/Cube_20200511215657.h b/.history/src/Cube_20200511215657.h deleted file mode 100644 index 391c7f2..0000000 --- a/.history/src/Cube_20200511215657.h +++ /dev/null @@ -1,26 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(Color c); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511215708.h b/.history/src/Cube_20200511215708.h deleted file mode 100644 index 661cfbb..0000000 --- a/.history/src/Cube_20200511215708.h +++ /dev/null @@ -1,27 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Color color; - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(Color c); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200511215722.cpp b/.history/src/Cube_20200511215722.cpp deleted file mode 100644 index ef15256..0000000 --- a/.history/src/Cube_20200511215722.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} - -Cube::Cube( - Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back -) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; -} - -void Cube::setColor(Color c) { - this->color=c; -} \ No newline at end of file diff --git a/.history/src/Cube_20200512000150.h b/.history/src/Cube_20200512000150.h deleted file mode 100644 index d1b5c3c..0000000 --- a/.history/src/Cube_20200512000150.h +++ /dev/null @@ -1,27 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - Color color; - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(myColor c); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200512000152.h b/.history/src/Cube_20200512000152.h deleted file mode 100644 index 13d985a..0000000 --- a/.history/src/Cube_20200512000152.h +++ /dev/null @@ -1,27 +0,0 @@ -#include "Quad.h" -#include "Vertex.h" - -class Cube { - public: - myColor color; - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(myColor c); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200512000204.cpp b/.history/src/Cube_20200512000204.cpp deleted file mode 100644 index f65b20c..0000000 --- a/.history/src/Cube_20200512000204.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "Cube.h" - -Cube::Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft -) { - this->btl=backTopLeft; - this->btr=backTopRight; - this->bbr=backBottomRight; - this->bbl=backBottomLeft; - this->ftl=frontTopRight; - this->ftl=frontTopRight; - this->fbl=frontBottomLeft; - this->fbr=frontBottomRight; -} - -Cube::Cube( - Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back -) { - this->left=left; - this->top=top; - this->right=right; - this->bottom=bottom; - this->front=front; - this->back=back; -} - -void Cube::setColor(myColor c) { - this->color=c; -} \ No newline at end of file diff --git a/.history/src/Cube_20200512005406.h b/.history/src/Cube_20200512005406.h deleted file mode 100644 index 90a7d6f..0000000 --- a/.history/src/Cube_20200512005406.h +++ /dev/null @@ -1,26 +0,0 @@ -#include "Vertex.h" - -class Cube { - public: - myColor color; - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(myColor c); -}; \ No newline at end of file diff --git a/.history/src/Cube_20200512005416.h b/.history/src/Cube_20200512005416.h deleted file mode 100644 index 9ab9c7b..0000000 --- a/.history/src/Cube_20200512005416.h +++ /dev/null @@ -1,26 +0,0 @@ -#include "Quad.h" - -class Cube { - public: - myColor color; - Quad left,top,right,bottom,back,front; - Vertex btl,btr,bbr,bbl,ftl,ftr,fbr,fbl; - - Cube(Vertex backTopLeft, - Vertex backTopRight, - Vertex backBottomRight, - Vertex backBottomLeft, - Vertex frontTopLeft, - Vertex frontTopRight, - Vertex frontBottomRight, - Vertex frontBottomLeft - ); - Cube(Quad left, - Quad top, - Quad right, - Quad bottom, - Quad front, - Quad back - ); - void setColor(myColor c); -}; \ No newline at end of file diff --git a/.history/src/Quad_20200511171624.h b/.history/src/Quad_20200511171624.h deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Quad_20200511171639.h b/.history/src/Quad_20200511171639.h deleted file mode 100644 index 29a87ad..0000000 --- a/.history/src/Quad_20200511171639.h +++ /dev/null @@ -1,19 +0,0 @@ -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511171657.h b/.history/src/Quad_20200511171657.h deleted file mode 100644 index 4bc4ef5..0000000 --- a/.history/src/Quad_20200511171657.h +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511171706.h b/.history/src/Quad_20200511171706.h deleted file mode 100644 index c1d364b..0000000 --- a/.history/src/Quad_20200511171706.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511171710.h b/.history/src/Quad_20200511171710.h deleted file mode 100644 index 78b780b..0000000 --- a/.history/src/Quad_20200511171710.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511171713.h b/.history/src/Quad_20200511171713.h deleted file mode 100644 index 78b780b..0000000 --- a/.history/src/Quad_20200511171713.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511171740.h b/.history/src/Quad_20200511171740.h deleted file mode 100644 index 3d2d840..0000000 --- a/.history/src/Quad_20200511171740.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175511.h b/.history/src/Quad_20200511175511.h deleted file mode 100644 index 60e01e0..0000000 --- a/.history/src/Quad_20200511175511.h +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - } -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175543.h b/.history/src/Quad_20200511175543.h deleted file mode 100644 index ac88536..0000000 --- a/.history/src/Quad_20200511175543.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175550.h b/.history/src/Quad_20200511175550.h deleted file mode 100644 index ac88536..0000000 --- a/.history/src/Quad_20200511175550.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175556.h b/.history/src/Quad_20200511175556.h deleted file mode 100644 index d951649..0000000 --- a/.history/src/Quad_20200511175556.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - }; -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175559.h b/.history/src/Quad_20200511175559.h deleted file mode 100644 index ac88536..0000000 --- a/.history/src/Quad_20200511175559.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175623.h b/.history/src/Quad_20200511175623.h deleted file mode 100644 index c3e9dc3..0000000 --- a/.history/src/Quad_20200511175623.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175926.h b/.history/src/Quad_20200511175926.h deleted file mode 100644 index f04fc1c..0000000 --- a/.history/src/Quad_20200511175926.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color(); - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511175932.h b/.history/src/Quad_20200511175932.h deleted file mode 100644 index c3e9dc3..0000000 --- a/.history/src/Quad_20200511175932.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184026.h b/.history/src/Quad_20200511184026.h deleted file mode 100644 index 687f013..0000000 --- a/.history/src/Quad_20200511184026.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184038.h b/.history/src/Quad_20200511184038.h deleted file mode 100644 index 687f013..0000000 --- a/.history/src/Quad_20200511184038.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184041.h b/.history/src/Quad_20200511184041.h deleted file mode 100644 index 687f013..0000000 --- a/.history/src/Quad_20200511184041.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(); - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184044.h b/.history/src/Quad_20200511184044.h deleted file mode 100644 index c3e9dc3..0000000 --- a/.history/src/Quad_20200511184044.h +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184053.h b/.history/src/Quad_20200511184053.h deleted file mode 100644 index fdf6081..0000000 --- a/.history/src/Quad_20200511184053.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184056.h b/.history/src/Quad_20200511184056.h deleted file mode 100644 index fdf6081..0000000 --- a/.history/src/Quad_20200511184056.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184723.h b/.history/src/Quad_20200511184723.h deleted file mode 100644 index fdf6081..0000000 --- a/.history/src/Quad_20200511184723.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511184816.h b/.history/src/Quad_20200511184816.h deleted file mode 100644 index a9dfb14..0000000 --- a/.history/src/Quad_20200511184816.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511185058.h b/.history/src/Quad_20200511185058.h deleted file mode 100644 index fdf6081..0000000 --- a/.history/src/Quad_20200511185058.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511200147.h b/.history/src/Quad_20200511200147.h deleted file mode 100644 index 4ae1441..0000000 --- a/.history/src/Quad_20200511200147.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511215736.cpp b/.history/src/Quad_20200511215736.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Quad_20200511215936.cpp b/.history/src/Quad_20200511215936.cpp deleted file mode 100644 index 511a71a..0000000 --- a/.history/src/Quad_20200511215936.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; - } \ No newline at end of file diff --git a/.history/src/Quad_20200511220007.cpp b/.history/src/Quad_20200511220007.cpp deleted file mode 100644 index c14d01b..0000000 --- a/.history/src/Quad_20200511220007.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220027.h b/.history/src/Quad_20200511220027.h deleted file mode 100644 index 14e7068..0000000 --- a/.history/src/Quad_20200511220027.h +++ /dev/null @@ -1,25 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220042.cpp b/.history/src/Quad_20200511220042.cpp deleted file mode 100644 index 05526b6..0000000 --- a/.history/src/Quad_20200511220042.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {}; \ No newline at end of file diff --git a/.history/src/Quad_20200511220043.cpp b/.history/src/Quad_20200511220043.cpp deleted file mode 100644 index 7ff42ef..0000000 --- a/.history/src/Quad_20200511220043.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} \ No newline at end of file diff --git a/.history/src/Quad_20200511220045.cpp b/.history/src/Quad_20200511220045.cpp deleted file mode 100644 index 299ea2c..0000000 --- a/.history/src/Quad_20200511220045.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} -Quad::Quad() {} \ No newline at end of file diff --git a/.history/src/Quad_20200511220046.cpp b/.history/src/Quad_20200511220046.cpp deleted file mode 100644 index 7ff42ef..0000000 --- a/.history/src/Quad_20200511220046.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} \ No newline at end of file diff --git a/.history/src/Quad_20200511220105.cpp b/.history/src/Quad_20200511220105.cpp deleted file mode 100644 index 4cda0ef..0000000 --- a/.history/src/Quad_20200511220105.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(Color c) { - -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220115.h b/.history/src/Quad_20200511220115.h deleted file mode 100644 index aeb5d15..0000000 --- a/.history/src/Quad_20200511220115.h +++ /dev/null @@ -1,25 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(Color c); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220118.h b/.history/src/Quad_20200511220118.h deleted file mode 100644 index f9e629d..0000000 --- a/.history/src/Quad_20200511220118.h +++ /dev/null @@ -1,21 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(Color c); - void render(); -}; - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220128.cpp b/.history/src/Quad_20200511220128.cpp deleted file mode 100644 index 9d27da3..0000000 --- a/.history/src/Quad_20200511220128.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(Color c) { - this->color=c; -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220143.cpp b/.history/src/Quad_20200511220143.cpp deleted file mode 100644 index 222a68f..0000000 --- a/.history/src/Quad_20200511220143.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(Color c) { - this->color=c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220149.cpp b/.history/src/Quad_20200511220149.cpp deleted file mode 100644 index 222a68f..0000000 --- a/.history/src/Quad_20200511220149.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(Color c) { - this->color=c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200511220152.h b/.history/src/Quad_20200511220152.h deleted file mode 100644 index 4f4a248..0000000 --- a/.history/src/Quad_20200511220152.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(Color c); - void render(); -}; \ No newline at end of file diff --git a/.history/src/Quad_20200511220156.cpp b/.history/src/Quad_20200511220156.cpp deleted file mode 100644 index 222a68f..0000000 --- a/.history/src/Quad_20200511220156.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(Color c) { - this->color=c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200512000121.cpp b/.history/src/Quad_20200512000121.cpp deleted file mode 100644 index 121dbd9..0000000 --- a/.history/src/Quad_20200512000121.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(myColor c) { - this->color=c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200512000128.h b/.history/src/Quad_20200512000128.h deleted file mode 100644 index fe8a2f8..0000000 --- a/.history/src/Quad_20200512000128.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(myColor c); - void render(); -}; \ No newline at end of file diff --git a/.history/src/Quad_20200512000132.h b/.history/src/Quad_20200512000132.h deleted file mode 100644 index fe8a2f8..0000000 --- a/.history/src/Quad_20200512000132.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(myColor c); - void render(); -}; \ No newline at end of file diff --git a/.history/src/Quad_20200512000134.h b/.history/src/Quad_20200512000134.h deleted file mode 100644 index fe8a2f8..0000000 --- a/.history/src/Quad_20200512000134.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(myColor c); - void render(); -}; \ No newline at end of file diff --git a/.history/src/Quad_20200512000139.h b/.history/src/Quad_20200512000139.h deleted file mode 100644 index c2b2a05..0000000 --- a/.history/src/Quad_20200512000139.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "Color.h" -#include "Vertex.h" -#include - -class Quad { - public: - myColor color; - Vertex topL,topR,botR,botL; - Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL); - Quad(); - void setColor(myColor c); - void render(); -}; \ No newline at end of file diff --git a/.history/src/Quad_20200512010256.cpp b/.history/src/Quad_20200512010256.cpp deleted file mode 100644 index 04973df..0000000 --- a/.history/src/Quad_20200512010256.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(myColor c) { - this->color=c; -} - -void Quad::render() { - printf("Rendering quad"); - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200512010259.cpp b/.history/src/Quad_20200512010259.cpp deleted file mode 100644 index 04973df..0000000 --- a/.history/src/Quad_20200512010259.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "Quad.h" - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(myColor c) { - this->color=c; -} - -void Quad::render() { - printf("Rendering quad"); - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200512010312.cpp b/.history/src/Quad_20200512010312.cpp deleted file mode 100644 index c6eb1bf..0000000 --- a/.history/src/Quad_20200512010312.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Quad.h" -#include - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(myColor c) { - this->color=c; -} - -void Quad::render() { - printf("Rendering quad"); - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200512010331.cpp b/.history/src/Quad_20200512010331.cpp deleted file mode 100644 index 3092d4a..0000000 --- a/.history/src/Quad_20200512010331.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Quad.h" -#include - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(myColor c) { - this->color=c; -} - -void Quad::render() { - printf("Rendering quad\n"); - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Quad_20200512010514.cpp b/.history/src/Quad_20200512010514.cpp deleted file mode 100644 index 2134b11..0000000 --- a/.history/src/Quad_20200512010514.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "Quad.h" -#include - -Quad::Quad(Vertex topL, Vertex topR, Vertex botR, Vertex botL) { - this->topL=topL; - this->topR=topR; - this->botR=botR; - this->botL=botL; -} - -Quad::Quad() {} - -void Quad::setColor(myColor c) { - this->color=c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} \ No newline at end of file diff --git a/.history/src/Vertex_20200511171556.h b/.history/src/Vertex_20200511171556.h deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Vertex_20200511171606.h b/.history/src/Vertex_20200511171606.h deleted file mode 100644 index 894e508..0000000 --- a/.history/src/Vertex_20200511171606.h +++ /dev/null @@ -1,4 +0,0 @@ -class Vertex { - public: - float x,y,z; -}; \ No newline at end of file diff --git a/.history/src/Vertex_20200511172125.h b/.history/src/Vertex_20200511172125.h deleted file mode 100644 index a38ae7b..0000000 --- a/.history/src/Vertex_20200511172125.h +++ /dev/null @@ -1,9 +0,0 @@ -class Vertex { - public: - float x,y,z; - Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - } -}; \ No newline at end of file diff --git a/.history/src/Vertex_20200511172637.h b/.history/src/Vertex_20200511172637.h deleted file mode 100644 index a38ae7b..0000000 --- a/.history/src/Vertex_20200511172637.h +++ /dev/null @@ -1,9 +0,0 @@ -class Vertex { - public: - float x,y,z; - Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - } -}; \ No newline at end of file diff --git a/.history/src/Vertex_20200511180436.h b/.history/src/Vertex_20200511180436.h deleted file mode 100644 index 31c98b9..0000000 --- a/.history/src/Vertex_20200511180436.h +++ /dev/null @@ -1,10 +0,0 @@ -class Vertex { - public: - float x,y,z; - Vertex(); - Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - } -}; \ No newline at end of file diff --git a/.history/src/Vertex_20200511220207.cpp b/.history/src/Vertex_20200511220207.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/Vertex_20200511220407.cpp b/.history/src/Vertex_20200511220407.cpp deleted file mode 100644 index 77d49cb..0000000 --- a/.history/src/Vertex_20200511220407.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "Vertex.h" - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; -} \ No newline at end of file diff --git a/.history/src/Vertex_20200511220725.cpp b/.history/src/Vertex_20200511220725.cpp deleted file mode 100644 index b95d28f..0000000 --- a/.history/src/Vertex_20200511220725.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Vertex.h" - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200511220729.h b/.history/src/Vertex_20200511220729.h deleted file mode 100644 index 51c0c21..0000000 --- a/.history/src/Vertex_20200511220729.h +++ /dev/null @@ -1,6 +0,0 @@ -class Vertex { - public: - float x,y,z; - Vertex(); - Vertex(float x, float y, float z); -}; \ No newline at end of file diff --git a/.history/src/Vertex_20200511220731.cpp b/.history/src/Vertex_20200511220731.cpp deleted file mode 100644 index b95d28f..0000000 --- a/.history/src/Vertex_20200511220731.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Vertex.h" - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200512010117.cpp b/.history/src/Vertex_20200512010117.cpp deleted file mode 100644 index 9b24af4..0000000 --- a/.history/src/Vertex_20200512010117.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Vertex.h" - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - printf("Created a vertex at %f,%f,%f") -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200512010119.cpp b/.history/src/Vertex_20200512010119.cpp deleted file mode 100644 index 82485ec..0000000 --- a/.history/src/Vertex_20200512010119.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Vertex.h" - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - printf("Created a vertex at %f,%f,%f"); -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200512010126.cpp b/.history/src/Vertex_20200512010126.cpp deleted file mode 100644 index 1e14b9a..0000000 --- a/.history/src/Vertex_20200512010126.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Vertex.h" - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - printf("Created a vertex at %f,%f,%f",x,y,z); -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200512010150.cpp b/.history/src/Vertex_20200512010150.cpp deleted file mode 100644 index c450d96..0000000 --- a/.history/src/Vertex_20200512010150.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Vertex.h" -#include -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - printf("Created a vertex at %f,%f,%f",x,y,z); -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200512010152.cpp b/.history/src/Vertex_20200512010152.cpp deleted file mode 100644 index 8c0592c..0000000 --- a/.history/src/Vertex_20200512010152.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "Vertex.h" -#include - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - printf("Created a vertex at %f,%f,%f",x,y,z); -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/Vertex_20200512010338.cpp b/.history/src/Vertex_20200512010338.cpp deleted file mode 100644 index a2b8180..0000000 --- a/.history/src/Vertex_20200512010338.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "Vertex.h" -#include - -Vertex::Vertex(float x, float y, float z) { - this->x=x; - this->y=y; - this->z=z; - printf("Created a vertex at %f,%f,%f\n",x,y,z); -} - -Vertex::Vertex() {} \ No newline at end of file diff --git a/.history/src/color_20200511171454.h b/.history/src/color_20200511171454.h deleted file mode 100644 index e69de29..0000000 diff --git a/.history/src/color_20200511171508.h b/.history/src/color_20200511171508.h deleted file mode 100644 index fce2787..0000000 --- a/.history/src/color_20200511171508.h +++ /dev/null @@ -1,10 +0,0 @@ -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; \ No newline at end of file diff --git a/.history/src/gl_20200511140709.cpp b/.history/src/gl_20200511140709.cpp deleted file mode 100644 index 1868b29..0000000 --- a/.history/src/gl_20200511140709.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include -#include - -int main() { - //glewExperimental = true; - if(!glfwInit()) { - printf("[ERROR] Failed to initialize GLEW"); - return -1; - } - glfwWindowHint(GLFW_SAMPLES, 4); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 4); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - - GLFWwindow *win; - win = glfwCreateWindow(400,400, "HydroSimulator", NULL, NULL); - if(win == NULL) { - printf("[ERROR] Could not create a glfw window"); - glfwTerminate(); - return -1; - } - glfwMakeContextCurrent(win); - glewExperimental=true; - if(glewInit() != GLEW_OK) { - printf("[ERROR] Failed to initialize GLEW"); - return -1; - } - - glfwSetInputMode(win, GLFW_STICKY_KEYS, GL_TRUE); - do { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(win); - glfwPollEvents(); - } while(glfwGetKey(win, GLFW_KEY_ESCAPE) != GLFW_PRESS && glfwWindowShouldClose(win) == 0); -} diff --git a/.history/src/gl_20200511175144.cpp b/.history/src/gl_20200511175144.cpp deleted file mode 100644 index 1868b29..0000000 --- a/.history/src/gl_20200511175144.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include -#include - -int main() { - //glewExperimental = true; - if(!glfwInit()) { - printf("[ERROR] Failed to initialize GLEW"); - return -1; - } - glfwWindowHint(GLFW_SAMPLES, 4); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 4); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - - GLFWwindow *win; - win = glfwCreateWindow(400,400, "HydroSimulator", NULL, NULL); - if(win == NULL) { - printf("[ERROR] Could not create a glfw window"); - glfwTerminate(); - return -1; - } - glfwMakeContextCurrent(win); - glewExperimental=true; - if(glewInit() != GLEW_OK) { - printf("[ERROR] Failed to initialize GLEW"); - return -1; - } - - glfwSetInputMode(win, GLFW_STICKY_KEYS, GL_TRUE); - do { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(win); - glfwPollEvents(); - } while(glfwGetKey(win, GLFW_KEY_ESCAPE) != GLFW_PRESS && glfwWindowShouldClose(win) == 0); -} diff --git a/.history/src/main_20200511141624.cpp b/.history/src/main_20200511141624.cpp deleted file mode 100644 index 41d6a42..0000000 --- a/.history/src/main_20200511141624.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex2f(-0.5,-0.5); - glVertex2f(0.5,-0.5); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511144632.cpp b/.history/src/main_20200511144632.cpp deleted file mode 100644 index 41d6a42..0000000 --- a/.history/src/main_20200511144632.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex2f(-0.5,-0.5); - glVertex2f(0.5,-0.5); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511145101.cpp b/.history/src/main_20200511145101.cpp deleted file mode 100644 index 69d8710..0000000 --- a/.history/src/main_20200511145101.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex2f(-0.5,-0.5); - glVertex2f(0.5,-0.5); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511150605.cpp b/.history/src/main_20200511150605.cpp deleted file mode 100644 index 69d8710..0000000 --- a/.history/src/main_20200511150605.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex2f(-0.5,-0.5); - glVertex2f(0.5,-0.5); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511151949.cpp b/.history/src/main_20200511151949.cpp deleted file mode 100644 index 69d8710..0000000 --- a/.history/src/main_20200511151949.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex2f(-0.5,-0.5); - glVertex2f(0.5,-0.5); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152157.cpp b/.history/src/main_20200511152157.cpp deleted file mode 100644 index 88dabb5..0000000 --- a/.history/src/main_20200511152157.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex3f(1.0f,1.0f,-1.0f); - glVertex(-1.0f,1.0f,-1.0f); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152206.cpp b/.history/src/main_20200511152206.cpp deleted file mode 100644 index 84b33ca..0000000 --- a/.history/src/main_20200511152206.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex3f(1.0f,1.0f,-1.0f); - glVertex3f(-1.0f,1.0f,-1.0f); - glVertex2f(0.5,0.5); - glVertex2f(-0.5,0.5); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152249.cpp b/.history/src/main_20200511152249.cpp deleted file mode 100644 index 3cbc9b8..0000000 --- a/.history/src/main_20200511152249.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glVertex3f(1.0f,1.0f,-1.0f); - glVertex3f(-1.0f,1.0f,-1.0f); - glVertex3f(-1.0f,1.0f,1.0f); - glVertex3f(1.0f,1.0f,1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152326.cpp b/.history/src/main_20200511152326.cpp deleted file mode 100644 index 5ccf81f..0000000 --- a/.history/src/main_20200511152326.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glColor3f(0.0f,1.0f,0.0f); - glVertex3f(1.0f,1.0f,-1.0f); - glVertex3f(-1.0f,1.0f,-1.0f); - glVertex3f(-1.0f,1.0f,1.0f); - glVertex3f(1.0f,1.0f,1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152538.cpp b/.history/src/main_20200511152538.cpp deleted file mode 100644 index b300ebb..0000000 --- a/.history/src/main_20200511152538.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f); // Green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - // Bottom face (y = -1.0f) - glColor3f(1.0f, 0.5f, 0.0f); // Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - // Front face (z = 1.0f) - glColor3f(1.0f, 0.0f, 0.0f); // Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - // Back face (z = -1.0f) - glColor3f(1.0f, 1.0f, 0.0f); // Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - // Left face (x = -1.0f) - glColor3f(0.0f, 0.0f, 1.0f); // Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - // Right face (x = 1.0f) - glColor3f(1.0f, 0.0f, 1.0f); // Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152716.cpp b/.history/src/main_20200511152716.cpp deleted file mode 100644 index f875230..0000000 --- a/.history/src/main_20200511152716.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152836.cpp b/.history/src/main_20200511152836.cpp deleted file mode 100644 index 4a8e98c..0000000 --- a/.history/src/main_20200511152836.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glTranslatef(1.5f,0.0f,-7.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511152956.cpp b/.history/src/main_20200511152956.cpp deleted file mode 100644 index 3d6176c..0000000 --- a/.history/src/main_20200511152956.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glTranslatef(0.0f,1.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153000.cpp b/.history/src/main_20200511153000.cpp deleted file mode 100644 index fde2e6a..0000000 --- a/.history/src/main_20200511153000.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glTranslatef(0.0f,0.5f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153143.cpp b/.history/src/main_20200511153143.cpp deleted file mode 100644 index f847ecb..0000000 --- a/.history/src/main_20200511153143.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glTranslatef(0.0f,-0.5f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153153.cpp b/.history/src/main_20200511153153.cpp deleted file mode 100644 index fde2e6a..0000000 --- a/.history/src/main_20200511153153.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glTranslatef(0.0f,0.5f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153206.cpp b/.history/src/main_20200511153206.cpp deleted file mode 100644 index 1de001f..0000000 --- a/.history/src/main_20200511153206.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glTranslatef(0.5f,0.5f,0.5f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153351.cpp b/.history/src/main_20200511153351.cpp deleted file mode 100644 index 420f8d9..0000000 --- a/.history/src/main_20200511153351.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.5f,0.5f,0.5f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153439.cpp b/.history/src/main_20200511153439.cpp deleted file mode 100644 index a0e5ed0..0000000 --- a/.history/src/main_20200511153439.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.5f,0.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153501.cpp b/.history/src/main_20200511153501.cpp deleted file mode 100644 index 55325fe..0000000 --- a/.history/src/main_20200511153501.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.3f,0.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153512.cpp b/.history/src/main_20200511153512.cpp deleted file mode 100644 index cf79207..0000000 --- a/.history/src/main_20200511153512.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(1.0f,0.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153525.cpp b/.history/src/main_20200511153525.cpp deleted file mode 100644 index f4e0325..0000000 --- a/.history/src/main_20200511153525.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153527.cpp b/.history/src/main_20200511153527.cpp deleted file mode 100644 index 3e322ad..0000000 --- a/.history/src/main_20200511153527.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,1.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153536.cpp b/.history/src/main_20200511153536.cpp deleted file mode 100644 index f4e0325..0000000 --- a/.history/src/main_20200511153536.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153539.cpp b/.history/src/main_20200511153539.cpp deleted file mode 100644 index 9c55e20..0000000 --- a/.history/src/main_20200511153539.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,1.0f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153548.cpp b/.history/src/main_20200511153548.cpp deleted file mode 100644 index 2c9b4a4..0000000 --- a/.history/src/main_20200511153548.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,1.5f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153600.cpp b/.history/src/main_20200511153600.cpp deleted file mode 100644 index bcb10fd..0000000 --- a/.history/src/main_20200511153600.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.2f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153617.cpp b/.history/src/main_20200511153617.cpp deleted file mode 100644 index a926795..0000000 --- a/.history/src/main_20200511153617.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -int scale = 0; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.2f); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153630.cpp b/.history/src/main_20200511153630.cpp deleted file mode 100644 index ebcf6b3..0000000 --- a/.history/src/main_20200511153630.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,); - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153654.cpp b/.history/src/main_20200511153654.cpp deleted file mode 100644 index 055ac49..0000000 --- a/.history/src/main_20200511153654.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,scale); - scale+=0.01f - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153655.cpp b/.history/src/main_20200511153655.cpp deleted file mode 100644 index 599aa85..0000000 --- a/.history/src/main_20200511153655.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,scale); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153712.cpp b/.history/src/main_20200511153712.cpp deleted file mode 100644 index 80068a6..0000000 --- a/.history/src/main_20200511153712.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,scale,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153828.cpp b/.history/src/main_20200511153828.cpp deleted file mode 100644 index 94a687e..0000000 --- a/.history/src/main_20200511153828.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(scale,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153840.cpp b/.history/src/main_20200511153840.cpp deleted file mode 100644 index 031b48c..0000000 --- a/.history/src/main_20200511153840.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(scale,scale,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153905.cpp b/.history/src/main_20200511153905.cpp deleted file mode 100644 index 0432038..0000000 --- a/.history/src/main_20200511153905.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153910.cpp b/.history/src/main_20200511153910.cpp deleted file mode 100644 index a6367df..0000000 --- a/.history/src/main_20200511153910.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.5f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153920.cpp b/.history/src/main_20200511153920.cpp deleted file mode 100644 index 0432038..0000000 --- a/.history/src/main_20200511153920.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153926.cpp b/.history/src/main_20200511153926.cpp deleted file mode 100644 index e25c425..0000000 --- a/.history/src/main_20200511153926.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.5f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153948.cpp b/.history/src/main_20200511153948.cpp deleted file mode 100644 index e581c83..0000000 --- a/.history/src/main_20200511153948.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(0.5f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511153957.cpp b/.history/src/main_20200511153957.cpp deleted file mode 100644 index 0432038..0000000 --- a/.history/src/main_20200511153957.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = 0.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511154013.cpp b/.history/src/main_20200511154013.cpp deleted file mode 100644 index e335cb5..0000000 --- a/.history/src/main_20200511154013.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511154031.cpp b/.history/src/main_20200511154031.cpp deleted file mode 100644 index a8fac37..0000000 --- a/.history/src/main_20200511154031.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, scale); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511154055.cpp b/.history/src/main_20200511154055.cpp deleted file mode 100644 index 3548264..0000000 --- a/.history/src/main_20200511154055.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, scale, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, scale); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511154127.cpp b/.history/src/main_20200511154127.cpp deleted file mode 100644 index 115131a..0000000 --- a/.history/src/main_20200511154127.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, scale, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, scale, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, scale); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511163804.cpp b/.history/src/main_20200511163804.cpp deleted file mode 100644 index e335cb5..0000000 --- a/.history/src/main_20200511163804.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511163907.cpp b/.history/src/main_20200511163907.cpp deleted file mode 100644 index e335cb5..0000000 --- a/.history/src/main_20200511163907.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511163917.cpp b/.history/src/main_20200511163917.cpp deleted file mode 100644 index e335cb5..0000000 --- a/.history/src/main_20200511163917.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511164038.cpp b/.history/src/main_20200511164038.cpp deleted file mode 100644 index e335cb5..0000000 --- a/.history/src/main_20200511164038.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f( 1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f( 1.0f, 1.0f, 1.0f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511164730.cpp b/.history/src/main_20200511164730.cpp deleted file mode 100644 index 15c32c0..0000000 --- a/.history/src/main_20200511164730.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511164948.cpp b/.history/src/main_20200511164948.cpp deleted file mode 100644 index b5663e6..0000000 --- a/.history/src/main_20200511164948.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165120.cpp b/.history/src/main_20200511165120.cpp deleted file mode 100644 index fe568c3..0000000 --- a/.history/src/main_20200511165120.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165122.cpp b/.history/src/main_20200511165122.cpp deleted file mode 100644 index ddccb63..0000000 --- a/.history/src/main_20200511165122.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; -}; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165240.cpp b/.history/src/main_20200511165240.cpp deleted file mode 100644 index fcdadca..0000000 --- a/.history/src/main_20200511165240.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void render(); -}; - -Quad::render() { - -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165437.cpp b/.history/src/main_20200511165437.cpp deleted file mode 100644 index f279f6b..0000000 --- a/.history/src/main_20200511165437.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void render(); -}; - -void Quad::render() { - -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165658.cpp b/.history/src/main_20200511165658.cpp deleted file mode 100644 index 4aa99bd..0000000 --- a/.history/src/main_20200511165658.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void render(); -}; - -void Quad::render() { - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165816.cpp b/.history/src/main_20200511165816.cpp deleted file mode 100644 index 4aa99bd..0000000 --- a/.history/src/main_20200511165816.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void render(); -}; - -void Quad::render() { - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165944.cpp b/.history/src/main_20200511165944.cpp deleted file mode 100644 index 79b37de..0000000 --- a/.history/src/main_20200511165944.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void setColor(); - void render(); -}; - -void Quad::setColor(Color color) { - -} - -void Quad::render() { - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511165954.cpp b/.history/src/main_20200511165954.cpp deleted file mode 100644 index 7ada889..0000000 --- a/.history/src/main_20200511165954.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color color) { - -} - -void Quad::render() { - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511170722.cpp b/.history/src/main_20200511170722.cpp deleted file mode 100644 index dda38c4..0000000 --- a/.history/src/main_20200511170722.cpp +++ /dev/null @@ -1,187 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color color) { - -} - -void Quad::render() { - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511170815.cpp b/.history/src/main_20200511170815.cpp deleted file mode 100644 index a8ad7ae..0000000 --- a/.history/src/main_20200511170815.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - c -} - -void Quad::render() { - glColor4f(); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511170819.cpp b/.history/src/main_20200511170819.cpp deleted file mode 100644 index c1033ee..0000000 --- a/.history/src/main_20200511170819.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511170856.cpp b/.history/src/main_20200511170856.cpp deleted file mode 100644 index c1033ee..0000000 --- a/.history/src/main_20200511170856.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511170941.cpp b/.history/src/main_20200511170941.cpp deleted file mode 100644 index a00c9ad..0000000 --- a/.history/src/main_20200511170941.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171006.cpp b/.history/src/main_20200511171006.cpp deleted file mode 100644 index a00c9ad..0000000 --- a/.history/src/main_20200511171006.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", gluErrorString(error)); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", gluErrorString(error)); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, "[ERROR] Could not initialize the OpenGL clear color\n%s\n", gluErrorString(error)); - success = false; - } - return success; -} -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} -void update() { -} -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171313.cpp b/.history/src/main_20200511171313.cpp deleted file mode 100644 index c283606..0000000 --- a/.history/src/main_20200511171313.cpp +++ /dev/null @@ -1,201 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171319.cpp b/.history/src/main_20200511171319.cpp deleted file mode 100644 index a81d026..0000000 --- a/.history/src/main_20200511171319.cpp +++ /dev/null @@ -1,202 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171334.cpp b/.history/src/main_20200511171334.cpp deleted file mode 100644 index a81d026..0000000 --- a/.history/src/main_20200511171334.cpp +++ /dev/null @@ -1,202 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Color { - public: - float r,g,b,a; - Color(float r,float g,float b,float a) { - this->r=r; - this->g=g; - this->b=b; - this->a=a; - } -}; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171517.cpp b/.history/src/main_20200511171517.cpp deleted file mode 100644 index ff776e3..0000000 --- a/.history/src/main_20200511171517.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171546.cpp b/.history/src/main_20200511171546.cpp deleted file mode 100644 index ff776e3..0000000 --- a/.history/src/main_20200511171546.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171549.cpp b/.history/src/main_20200511171549.cpp deleted file mode 100644 index 3cc97e1..0000000 --- a/.history/src/main_20200511171549.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Vertex { - public: - float x,y,z; -}; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171615.cpp b/.history/src/main_20200511171615.cpp deleted file mode 100644 index 5493cef..0000000 --- a/.history/src/main_20200511171615.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -class Quad { - public: - Color color; - Vertex topL,topR,botR,botL; - void setColor(Color color); - void render(); -}; - -void Quad::setColor(Color c) { - color = c; -} - -void Quad::render() { - glColor4f(color.r,color.g,color.b,color.a); - glVertex3f(topL.x,topL.y,topL.z); - glVertex3f(topR.x,topR.y,topR.z); - glVertex3f(botR.x,botR.y,botR.z); - glVertex3f(botL.x,botL.y,botL.z); -} - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511171753.cpp b/.history/src/main_20200511171753.cpp deleted file mode 100644 index 654c3d8..0000000 --- a/.history/src/main_20200511171753.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511175200.cpp b/.history/src/main_20200511175200.cpp deleted file mode 100644 index 654c3d8..0000000 --- a/.history/src/main_20200511175200.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511175201.cpp b/.history/src/main_20200511175201.cpp deleted file mode 100644 index 654c3d8..0000000 --- a/.history/src/main_20200511175201.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511175225.cpp b/.history/src/main_20200511175225.cpp deleted file mode 100644 index d898d0e..0000000 --- a/.history/src/main_20200511175225.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511175904.cpp b/.history/src/main_20200511175904.cpp deleted file mode 100644 index d898d0e..0000000 --- a/.history/src/main_20200511175904.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511180500.cpp b/.history/src/main_20200511180500.cpp deleted file mode 100644 index d898d0e..0000000 --- a/.history/src/main_20200511180500.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511185350.cpp b/.history/src/main_20200511185350.cpp deleted file mode 100644 index d898d0e..0000000 --- a/.history/src/main_20200511185350.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f);//green - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - - glColor3f(1.0f, 0.5f, 0.0f);// Orange - glVertex3f( 1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f( 1.0f, -1.0f, -1.0f); - - glColor3f(1.0f, 0.0f, 0.0f);// Red - glVertex3f( 1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glVertex3f( 1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 1.0f, 0.0f);// Yellow - glVertex3f( 1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f( 1.0f, 1.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f);// Blue - glVertex3f(-1.0f, 1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - glColor3f(1.0f, 0.0f, 1.0f);// Magenta - glVertex3f(1.0f, 1.0f, -1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511185420.cpp b/.history/src/main_20200511185420.cpp deleted file mode 100644 index 8a6747d..0000000 --- a/.history/src/main_20200511185420.cpp +++ /dev/null @@ -1,134 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511191949.cpp b/.history/src/main_20200511191949.cpp deleted file mode 100644 index e7bd210..0000000 --- a/.history/src/main_20200511191949.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511192159.cpp b/.history/src/main_20200511192159.cpp deleted file mode 100644 index 2d81a93..0000000 --- a/.history/src/main_20200511192159.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex tlb(-0.5f,0.5f,-0.5f); -Vertex trb(0.5f,0.5f,) - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194222.cpp b/.history/src/main_20200511194222.cpp deleted file mode 100644 index 8cc9020..0000000 --- a/.history/src/main_20200511194222.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194426.cpp b/.history/src/main_20200511194426.cpp deleted file mode 100644 index 4984d9c..0000000 --- a/.history/src/main_20200511194426.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194624.cpp b/.history/src/main_20200511194624.cpp deleted file mode 100644 index 4b267a4..0000000 --- a/.history/src/main_20200511194624.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194806.cpp b/.history/src/main_20200511194806.cpp deleted file mode 100644 index 8e3b244..0000000 --- a/.history/src/main_20200511194806.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194836.cpp b/.history/src/main_20200511194836.cpp deleted file mode 100644 index 1320c3e..0000000 --- a/.history/src/main_20200511194836.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194848.cpp b/.history/src/main_20200511194848.cpp deleted file mode 100644 index 96df6f9..0000000 --- a/.history/src/main_20200511194848.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194909.cpp b/.history/src/main_20200511194909.cpp deleted file mode 100644 index d9ee635..0000000 --- a/.history/src/main_20200511194909.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -left.setColor(); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511194919.cpp b/.history/src/main_20200511194919.cpp deleted file mode 100644 index 96df6f9..0000000 --- a/.history/src/main_20200511194919.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195619.cpp b/.history/src/main_20200511195619.cpp deleted file mode 100644 index 756f8ed..0000000 --- a/.history/src/main_20200511195619.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - left.setColor() - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195626.cpp b/.history/src/main_20200511195626.cpp deleted file mode 100644 index f8cdc0d..0000000 --- a/.history/src/main_20200511195626.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - left.setColor(); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195635.cpp b/.history/src/main_20200511195635.cpp deleted file mode 100644 index c0d61a3..0000000 --- a/.history/src/main_20200511195635.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - left.setColor(RED_f4); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195700.cpp b/.history/src/main_20200511195700.cpp deleted file mode 100644 index 5752e12..0000000 --- a/.history/src/main_20200511195700.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195754.cpp b/.history/src/main_20200511195754.cpp deleted file mode 100644 index fbf2e62..0000000 --- a/.history/src/main_20200511195754.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195830.cpp b/.history/src/main_20200511195830.cpp deleted file mode 100644 index a3913b1..0000000 --- a/.history/src/main_20200511195830.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195907.cpp b/.history/src/main_20200511195907.cpp deleted file mode 100644 index af4f752..0000000 --- a/.history/src/main_20200511195907.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include <"Quad.h"> - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195930.cpp b/.history/src/main_20200511195930.cpp deleted file mode 100644 index 5fc5975..0000000 --- a/.history/src/main_20200511195930.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include <"src/Quad.h"> - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195933.cpp b/.history/src/main_20200511195933.cpp deleted file mode 100644 index 5fc5975..0000000 --- a/.history/src/main_20200511195933.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include <"src/Quad.h"> - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511195942.cpp b/.history/src/main_20200511195942.cpp deleted file mode 100644 index af4f752..0000000 --- a/.history/src/main_20200511195942.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include <"Quad.h"> - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511200052.cpp b/.history/src/main_20200511200052.cpp deleted file mode 100644 index 019cdf7..0000000 --- a/.history/src/main_20200511200052.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511200156.cpp b/.history/src/main_20200511200156.cpp deleted file mode 100644 index 019cdf7..0000000 --- a/.history/src/main_20200511200156.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511235857.cpp b/.history/src/main_20200511235857.cpp deleted file mode 100644 index 92cbe27..0000000 --- a/.history/src/main_20200511235857.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511235900.cpp b/.history/src/main_20200511235900.cpp deleted file mode 100644 index 019cdf7..0000000 --- a/.history/src/main_20200511235900.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511235911.cpp b/.history/src/main_20200511235911.cpp deleted file mode 100644 index 14f0437..0000000 --- a/.history/src/main_20200511235911.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" -#inclide "Color.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200511235939.cpp b/.history/src/main_20200511235939.cpp deleted file mode 100644 index 5a45de2..0000000 --- a/.history/src/main_20200511235939.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" -#include "Color.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(Color(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512000104.cpp b/.history/src/main_20200512000104.cpp deleted file mode 100644 index 1fcf9eb..0000000 --- a/.history/src/main_20200512000104.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" -#include "Color.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(Color(GREEN_f4)); - right.setColor(Color(BLUE_f4)); - bottom.setColor(Color(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512000113.cpp b/.history/src/main_20200512000113.cpp deleted file mode 100644 index 46f6059..0000000 --- a/.history/src/main_20200512000113.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" -#include "Color.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512000411.cpp b/.history/src/main_20200512000411.cpp deleted file mode 100644 index 455a831..0000000 --- a/.history/src/main_20200512000411.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(RED_f4); - top.setColor(GREEN_f4); - right.setColor(BLUE_f4); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512000429.cpp b/.history/src/main_20200512000429.cpp deleted file mode 100644 index e4ff6e7..0000000 --- a/.history/src/main_20200512000429.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(RED_f4); - top.setColor(GREEN_f4); - right.setColor(BLUE_f4); - bottom.setColor(PURPLE_f4); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512000549.cpp b/.history/src/main_20200512000549.cpp deleted file mode 100644 index 75d1002..0000000 --- a/.history/src/main_20200512000549.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512000614.cpp b/.history/src/main_20200512000614.cpp deleted file mode 100644 index 998ddb0..0000000 --- a/.history/src/main_20200512000614.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010342.cpp b/.history/src/main_20200512010342.cpp deleted file mode 100644 index 998ddb0..0000000 --- a/.history/src/main_20200512010342.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010405.cpp b/.history/src/main_20200512010405.cpp deleted file mode 100644 index dcaf1c4..0000000 --- a/.history/src/main_20200512010405.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010408.cpp b/.history/src/main_20200512010408.cpp deleted file mode 100644 index 9c8a06f..0000000 --- a/.history/src/main_20200512010408.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010440.cpp b/.history/src/main_20200512010440.cpp deleted file mode 100644 index da5a708..0000000 --- a/.history/src/main_20200512010440.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010451.cpp b/.history/src/main_20200512010451.cpp deleted file mode 100644 index 17aa21b..0000000 --- a/.history/src/main_20200512010451.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010535.cpp b/.history/src/main_20200512010535.cpp deleted file mode 100644 index 17aa21b..0000000 --- a/.history/src/main_20200512010535.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010630.cpp b/.history/src/main_20200512010630.cpp deleted file mode 100644 index 6f77461..0000000 --- a/.history/src/main_20200512010630.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010633.cpp b/.history/src/main_20200512010633.cpp deleted file mode 100644 index 6f77461..0000000 --- a/.history/src/main_20200512010633.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010641.cpp b/.history/src/main_20200512010641.cpp deleted file mode 100644 index 23ce2f5..0000000 --- a/.history/src/main_20200512010641.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010651.cpp b/.history/src/main_20200512010651.cpp deleted file mode 100644 index 8d0f19f..0000000 --- a/.history/src/main_20200512010651.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /*left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010809.cpp b/.history/src/main_20200512010809.cpp deleted file mode 100644 index 71b5467..0000000 --- a/.history/src/main_20200512010809.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /*left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glVertex2f(-0.5f,0.5f); - glVertex2f(0.5f,0.5f); - glVertex2f(0.5f,-0.5f); - glVertex(-0.5f,-0.5f) -; glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010815.cpp b/.history/src/main_20200512010815.cpp deleted file mode 100644 index 4d81ada..0000000 --- a/.history/src/main_20200512010815.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /*left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glVertex2f(-0.5f,0.5f); - glVertex2f(0.5f,0.5f); - glVertex2f(0.5f,-0.5f); - glVertex(-0.5f,-0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010819.cpp b/.history/src/main_20200512010819.cpp deleted file mode 100644 index 4d81ada..0000000 --- a/.history/src/main_20200512010819.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /*left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glVertex2f(-0.5f,0.5f); - glVertex2f(0.5f,0.5f); - glVertex2f(0.5f,-0.5f); - glVertex(-0.5f,-0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010823.cpp b/.history/src/main_20200512010823.cpp deleted file mode 100644 index ee47132..0000000 --- a/.history/src/main_20200512010823.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /*left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glVertex2f(-0.5f,0.5f); - glVertex2f(0.5f,0.5f); - glVertex2f(0.5f,-0.5f); - glVertex2f(-0.5f,-0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512010947.cpp b/.history/src/main_20200512010947.cpp deleted file mode 100644 index e5d032b..0000000 --- a/.history/src/main_20200512010947.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /*left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011009.cpp b/.history/src/main_20200512011009.cpp deleted file mode 100644 index 276b7f5..0000000 --- a/.history/src/main_20200512011009.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.render(); - top.render(); - right.render(); - bottom.render(); - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011055.cpp b/.history/src/main_20200512011055.cpp deleted file mode 100644 index 74be268..0000000 --- a/.history/src/main_20200512011055.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - //left.render(); - //top.render(); - //right.render(); - //bottom.render(); - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011126.cpp b/.history/src/main_20200512011126.cpp deleted file mode 100644 index 5848b74..0000000 --- a/.history/src/main_20200512011126.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - //left.render(); - //top.render(); - //right.render(); - //bottom.render(); - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011142.cpp b/.history/src/main_20200512011142.cpp deleted file mode 100644 index affc053..0000000 --- a/.history/src/main_20200512011142.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - //left.render(); - //top.render(); - //right.render(); - //bottom.render(); - front.render(); - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011153.cpp b/.history/src/main_20200512011153.cpp deleted file mode 100644 index 490b858..0000000 --- a/.history/src/main_20200512011153.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - //left.render(); - //top.render(); - //right.render(); - //bottom.render(); - front.render(); - /* - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - */ - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011236.cpp b/.history/src/main_20200512011236.cpp deleted file mode 100644 index 29b402d..0000000 --- a/.history/src/main_20200512011236.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - //left.render(); - //top.render(); - //right.render(); - //bottom.render(); - front.setColor(myColor(1.0,1.0,1.0,1.0)); - front.render(); - /* - glVertex3f(-0.5f,0.5f,0.5f); - glVertex3f(0.5f,0.5f,0.5f); - glVertex3f(0.5f,-0.5f,0.5f); - glVertex3f(-0.5f,-0.5f,0.5f); - */ - glEnd(); - } -} - -int main() { - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011317.cpp b/.history/src/main_20200512011317.cpp deleted file mode 100644 index 3ecd9bf..0000000 --- a/.history/src/main_20200512011317.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - left.render(); - top.render(); - right.render(); - bottom.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011351.cpp b/.history/src/main_20200512011351.cpp deleted file mode 100644 index 0a1e1bf..0000000 --- a/.history/src/main_20200512011351.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - left.render(); - top.render(); - right.render(); - bottom.render(); - */ - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011417.cpp b/.history/src/main_20200512011417.cpp deleted file mode 100644 index a5f5abc..0000000 --- a/.history/src/main_20200512011417.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - left.render(); - top.render(); - right.render(); - bottom.render(); - */ - front.setColor(myColor(1,1,1,1)); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011436.cpp b/.history/src/main_20200512011436.cpp deleted file mode 100644 index 9e327b5..0000000 --- a/.history/src/main_20200512011436.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - left.render(); - top.render(); - right.render(); - bottom.render(); - */ - front.setColor(myColor(1,1,1,1)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011507.cpp b/.history/src/main_20200512011507.cpp deleted file mode 100644 index bda62f8..0000000 --- a/.history/src/main_20200512011507.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - left.render(); - top.render(); - right.render(); - bottom.render(); - */ - front.setColor(myColor(1,0,1,1)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011542.cpp b/.history/src/main_20200512011542.cpp deleted file mode 100644 index 41e182b..0000000 --- a/.history/src/main_20200512011542.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - top.render(); - right.render(); - bottom.render(); - (/) - front.setColor(myColor(1,0,1,1)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011547.cpp b/.history/src/main_20200512011547.cpp deleted file mode 100644 index 45b2a7b..0000000 --- a/.history/src/main_20200512011547.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - top.render(); - right.render(); - bottom.render(); - */ - front.setColor(myColor(1,0,1,1)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011559.cpp b/.history/src/main_20200512011559.cpp deleted file mode 100644 index fd69353..0000000 --- a/.history/src/main_20200512011559.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - top.render(); - right.render(); - bottom.render(); - */ - front.setColor(myColor(RED_f4)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011641.cpp b/.history/src/main_20200512011641.cpp deleted file mode 100644 index 0f75fe0..0000000 --- a/.history/src/main_20200512011641.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - /* - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - right.setColor(myColor(BLUE_f4)); - bottom.setColor(myColor(PURPLE_f4)); - top.render(); - right.render(); - bottom.render(); - */ - front.setColor(myColor(WHITE_f4)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011807.cpp b/.history/src/main_20200512011807.cpp deleted file mode 100644 index d6373e4..0000000 --- a/.history/src/main_20200512011807.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - top.render(); - right.setColor(myColor(BLUE_f4)); - right.render(); - bottom.setColor(myColor(PURPLE_f4)); - bottom.render(); - front.setColor(myColor(WHITE_f4)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011831.cpp b/.history/src/main_20200512011831.cpp deleted file mode 100644 index 0307433..0000000 --- a/.history/src/main_20200512011831.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - top.render(); - right.setColor(myColor(BLUE_f4)); - right.render(); - bottom.setColor(myColor(PURPLE_f4)); - bottom.render(); - front.setColor(myColor(1,1,1,.5)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011844.cpp b/.history/src/main_20200512011844.cpp deleted file mode 100644 index 42ae6c3..0000000 --- a/.history/src/main_20200512011844.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - top.render(); - right.setColor(myColor(BLUE_f4)); - right.render(); - bottom.setColor(myColor(PURPLE_f4)); - bottom.render(); - front.setColor(myColor(1,1,1,.2)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011858.cpp b/.history/src/main_20200512011858.cpp deleted file mode 100644 index 70335ae..0000000 --- a/.history/src/main_20200512011858.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - top.render(); - right.setColor(myColor(BLUE_f4)); - right.render(); - bottom.setColor(myColor(PURPLE_f4)); - bottom.render(); - front.setColor(myColor(0,0,0,0)); - front.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.history/src/main_20200512011906.cpp b/.history/src/main_20200512011906.cpp deleted file mode 100644 index 36cd6d7..0000000 --- a/.history/src/main_20200512011906.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "Quad.h" - -SDL_Window *gWindow = NULL; -SDL_GLContext gContext; - -bool gRenderQuad = true; -int width=500,height=500; - -bool init() { - bool success = true; - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - fprintf(stderr, "[ERROR] Could not initialize SDL video\n%s\n", SDL_GetError()); - success = false; - } else { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); - gWindow = SDL_CreateWindow("Hydro Simulator", - SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, - height, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN - ); - if(gWindow == NULL) { - - fprintf(stderr, "[ERROR] Could not create an SDL window\n%s\n", SDL_GetError()); - success = false; - - } else { - gContext = SDL_GL_CreateContext(gWindow); - if(gContext == NULL) { - fprintf(stderr, "[ERROR]Could not create an SDL OpenGL context\n%s\n", SDL_GetError()); - success = false; - } else { - if(SDL_GL_SetSwapInterval(1) < 0) { - fprintf(stderr, "[ERROR] Could not set SDL vsync\n%s\n", SDL_GetError()); - success = false; - } - } - } - } - return success; -} - -bool initGL() { - bool success = true; - GLenum error = GL_NO_ERROR; - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix projection\n%s\n", - gluErrorString(error) - ); - success = false; - } - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize OpenGL matrix modelview\n%s\n", - gluErrorString(error) - ); - success = false; - } - glClearColor(0,0,0,255); - error = glGetError(); - if(error != GL_NO_ERROR) { - fprintf(stderr, - "[ERROR] Could not initialize the OpenGL clear color\n%s\n", - gluErrorString(error) - ); - success = false; - } - return success; -} - -void handleKeys(unsigned char key, int x, int y) { - if(key == 'q') { - gRenderQuad = !gRenderQuad; - } else { - if(key==SDL_SCANCODE_ESCAPE) { - gRenderQuad = false; - } - } -} - -void update() { -} - -float a = 0.5f; -Vertex btl(-0.5f,0.5f,-0.5f); -Vertex btr(0.5f,0.5f,-0.5f); -Vertex bbr(0.5f,-0.5f,-0.5f); -Vertex bbl(-0.5f,-0.5f,-0.5f); - -Vertex ftl(-0.5f,0.5f,0.5f); -Vertex ftr(0.5f,0.5f,0.5f); -Vertex fbr(0.5f,-0.5f,0.5f); -Vertex fbl(-0.5f,-0.5f,0.5f); - -Quad left(btl,ftl,bbl,fbl); -Quad top(btl,btr,ftl,ftr); -Quad right(ftr,btr,fbr,bbr); -Quad bottom(fbl,fbr,bbl,bbr); -Quad front(ftl,ftr,fbr,fbl); - -float scale = -1.0f; -void render() { - glClear(GL_COLOR_BUFFER_BIT); - if(gRenderQuad) { - glLoadIdentity(); - //glTranslatef(0.0f,0.0f,0.0f); - //scale+=0.01f; - glBegin(GL_QUADS); - left.setColor(myColor(RED_f4)); - left.render(); - top.setColor(myColor(GREEN_f4)); - top.render(); - right.setColor(myColor(BLUE_f4)); - right.render(); - bottom.setColor(myColor(PURPLE_f4)); - bottom.render(); - glEnd(); - } -} - -int main() { - init(); - initGL(); - SDL_StartTextInput(); - bool quit = false; - SDL_Event e; - printf("Succesfully initialized\n"); - while(!quit) { - while(SDL_PollEvent(&e) != 0) { - if(e.type == SDL_QUIT) { - quit = true; - } else { - if(e.type == SDL_TEXTINPUT) { - int x=0,y=0; - SDL_GetMouseState(&x,&y); - handleKeys(e.text.text[0], x, y); - } - } - } - render(); - SDL_GL_SwapWindow(gWindow); - } - SDL_StopTextInput(); - return 0; -} diff --git a/.kdev4/hs-cpp.kdev4 b/.kdev4/hs-cpp.kdev4 deleted file mode 100644 index 6ed5f8c..0000000 --- a/.kdev4/hs-cpp.kdev4 +++ /dev/null @@ -1,2 +0,0 @@ -[Buildset] -BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x0c\x00h\x00s\x00-\x00c\x00p\x00p) diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e8abdf5..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "workbench.colorCustomizations": { - "activityBar.activeBackground": "#9000bd", - "activityBar.activeBorder": "#201800", - "activityBar.background": "#9000bd", - "activityBar.foreground": "#e7e7e7", - "activityBar.inactiveForeground": "#e7e7e799", - "activityBarBadge.background": "#201800", - "activityBarBadge.foreground": "#e7e7e7", - "statusBar.background": "#69008a", - "statusBar.border": "#69008a", - "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#9000bd", - "titleBar.activeBackground": "#69008a", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.border": "#69008a", - "titleBar.inactiveBackground": "#69008a99", - "titleBar.inactiveForeground": "#e7e7e799" - }, - "peacock.color": "#69008a", - "cSpell.words": [ - "OPENGL", - "Translatef" - ] -} \ No newline at end of file diff --git a/hs-cpp.kdev4 b/hs-cpp.kdev4 deleted file mode 100644 index 2e2c330..0000000 --- a/hs-cpp.kdev4 +++ /dev/null @@ -1,4 +0,0 @@ -[Project] -CreatedFrom=Makefile -Manager=KDevCustomMakeManager -Name=hs-cpp