Skip to content

Commit 54e9c99

Browse files
Merge pull request #3 from AdarshRevankar/codeblocks
Codeblocks
2 parents 9a039cb + 928874b commit 54e9c99

26 files changed

+1587
-64
lines changed

Desktop-Simulator.cbp

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="Desktop-Simulator" />
6+
<Option pch_mode="2" />
7+
<Option compiler="gcc" />
8+
<Build>
9+
<Target title="Debug">
10+
<Option output="bin/Debug/Desktop-Simulation" prefix_auto="1" extension_auto="1" />
11+
<Option object_output="obj/Debug/" />
12+
<Option type="1" />
13+
<Option compiler="gcc" />
14+
<Compiler>
15+
<Add option="-g" />
16+
</Compiler>
17+
</Target>
18+
<Target title="Release">
19+
<Option output="bin/Release/Desktop-Simulation" prefix_auto="1" extension_auto="1" />
20+
<Option object_output="obj/Release/" />
21+
<Option type="0" />
22+
<Option compiler="gcc" />
23+
<Compiler>
24+
<Add option="-O2" />
25+
</Compiler>
26+
<Linker>
27+
<Add option="-s" />
28+
</Linker>
29+
</Target>
30+
</Build>
31+
<Compiler>
32+
<Add option="-Wall" />
33+
</Compiler>
34+
<Linker>
35+
<Add library="opengl32" />
36+
<Add library="glu32" />
37+
<Add library="gdi32" />
38+
<Add library="freeglut" />
39+
</Linker>
40+
<Unit filename="bitmap.h" />
41+
<Unit filename="bmpLoader.h" />
42+
<Unit filename="cpu_cable.h" />
43+
<Unit filename="cpu_case.h" />
44+
<Unit filename="cpu_chipset.h" />
45+
<Unit filename="cpu_fan.h" />
46+
<Unit filename="cpu_gpu.h" />
47+
<Unit filename="cpu_harddisk.h" />
48+
<Unit filename="cpu_motherboard.h" />
49+
<Unit filename="cpu_psu.h" />
50+
<Unit filename="cpu_ram.h" />
51+
<Unit filename="dragHandler.h" />
52+
<Unit filename="env_table.h" />
53+
<Unit filename="environment_objects.h" />
54+
<Unit filename="light.h" />
55+
<Unit filename="main.cpp" />
56+
<Unit filename="motion.h" />
57+
<Unit filename="objects.h" />
58+
<Unit filename="parameter.h" />
59+
<Extensions>
60+
<code_completion />
61+
<envvars />
62+
<debugger />
63+
<lib_finder disable_auto="1" />
64+
</Extensions>
65+
</Project>
66+
</CodeBlocks_project_file>

Desktop-Simulator.depend

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# depslib dependency file v1.0
2+
1446667738 source:c:\users\adars\desktop\opengl trial\desktop-simulation\main.c
3+
<windows.h>
4+
<gl/gl.h>
5+
6+
1587467583 source:c:\users\adars\desktop\opengl trial\desktop-simulation\main.cpp
7+
<GL/glut.h>
8+
<GL/freeglut_ext.h>
9+
<iostream>
10+
"parameter.h"
11+
"motion.h"
12+
"objects.h"
13+
"bitmap.h"
14+
"light.h"
15+
16+
1587467963 c:\users\adars\desktop\opengl trial\desktop-simulation\parameter.h
17+
<math.h>
18+
<GL/glut.h>
19+
20+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\motion.h
21+
"parameter.h"
22+
"objects.h"
23+
24+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\objects.h
25+
<GL/glut.h>
26+
<GL/freeglut.h>
27+
"bmpLoader.h"
28+
"cpu_fan.h"
29+
"cpu_motherboard.h"
30+
"cpu_case.h"
31+
"cpu_ram.h"
32+
"cpu_chipset.h"
33+
"cpu_gpu.h"
34+
"cpu_psu.h"
35+
"cpu_harddisk.h"
36+
"environment_objects.h"
37+
"env_table.h"
38+
"cpu_cable.h"
39+
40+
1587467011 c:\users\adars\desktop\opengl trial\desktop-simulation\bmploader.h
41+
<windows.h>
42+
<GL/glut.h>
43+
<stdio.h>
44+
45+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_fan.h
46+
"parameter.h"
47+
"dragHandler.h"
48+
49+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\draghandler.h
50+
51+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_motherboard.h
52+
<GL/glut.h>
53+
"dragHandler.h"
54+
"parameter.h"
55+
56+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_case.h
57+
<GL/glut.h>
58+
"cpu_fan.h"
59+
60+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_ram.h
61+
"parameter.h"
62+
63+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_chipset.h
64+
"parameter.h"
65+
66+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_gpu.h
67+
"parameter.h"
68+
69+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_psu.h
70+
"parameter.h"
71+
"bitmap.h"
72+
73+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\bitmap.h
74+
<GL/glut.h>
75+
76+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_harddisk.h
77+
"parameter.h"
78+
79+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\environment_objects.h
80+
"parameter.h"
81+
<math.h>
82+
83+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\env_table.h
84+
"parameter.h"
85+
86+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\cpu_cable.h
87+
<GL/glut.h>
88+
89+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulation\light.h
90+
<GL/glut.h>
91+
92+
1587469003 source:c:\users\adars\desktop\opengl trial\desktop-simulator\main.cpp
93+
<GL/glut.h>
94+
<iostream>
95+
"parameter.h"
96+
"motion.h"
97+
"objects.h"
98+
"bitmap.h"
99+
"light.h"
100+
101+
1587467963 c:\users\adars\desktop\opengl trial\desktop-simulator\parameter.h
102+
<math.h>
103+
<GL/glut.h>
104+
105+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\motion.h
106+
"parameter.h"
107+
"objects.h"
108+
109+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\objects.h
110+
<GL/glut.h>
111+
<GL/freeglut.h>
112+
"bmpLoader.h"
113+
"cpu_fan.h"
114+
"cpu_motherboard.h"
115+
"cpu_case.h"
116+
"cpu_ram.h"
117+
"cpu_chipset.h"
118+
"cpu_gpu.h"
119+
"cpu_psu.h"
120+
"cpu_harddisk.h"
121+
"environment_objects.h"
122+
"env_table.h"
123+
"cpu_cable.h"
124+
125+
1587467011 c:\users\adars\desktop\opengl trial\desktop-simulator\bmploader.h
126+
<windows.h>
127+
<GL/glut.h>
128+
<stdio.h>
129+
130+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_fan.h
131+
"parameter.h"
132+
"dragHandler.h"
133+
134+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\draghandler.h
135+
136+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_motherboard.h
137+
<GL/glut.h>
138+
"dragHandler.h"
139+
"parameter.h"
140+
141+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_case.h
142+
<GL/glut.h>
143+
"cpu_fan.h"
144+
145+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_ram.h
146+
"parameter.h"
147+
148+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_chipset.h
149+
"parameter.h"
150+
151+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_gpu.h
152+
"parameter.h"
153+
154+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_psu.h
155+
"parameter.h"
156+
"bitmap.h"
157+
158+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\bitmap.h
159+
<GL/glut.h>
160+
161+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_harddisk.h
162+
"parameter.h"
163+
164+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\environment_objects.h
165+
"parameter.h"
166+
<math.h>
167+
168+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\env_table.h
169+
"parameter.h"
170+
171+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\cpu_cable.h
172+
<GL/glut.h>
173+
174+
1587377455 c:\users\adars\desktop\opengl trial\desktop-simulator\light.h
175+
<GL/glut.h>
176+

Desktop-Simulator.layout

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_layout_file>
3+
<FileVersion major="1" minor="0" />
4+
<ActiveTarget name="Release" />
5+
<File name="bmpLoader.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
6+
<Cursor>
7+
<Cursor1 position="277" topLine="0" />
8+
</Cursor>
9+
</File>
10+
<File name="main.cpp" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
11+
<Cursor>
12+
<Cursor1 position="507" topLine="0" />
13+
</Cursor>
14+
</File>
15+
<File name="cpu_case.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
16+
<Cursor>
17+
<Cursor1 position="9443" topLine="358" />
18+
</Cursor>
19+
</File>
20+
<File name="motion.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
21+
<Cursor>
22+
<Cursor1 position="3520" topLine="133" />
23+
</Cursor>
24+
</File>
25+
<File name="parameter.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
26+
<Cursor>
27+
<Cursor1 position="30" topLine="0" />
28+
</Cursor>
29+
</File>
30+
</CodeBlocks_layout_file>

README.md

+44-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
1-
# GRAPHICAL SIMULATION OF DESKTOP AND ITS COMPONENTS
1+
# Desktop Simulator
2+
[![Inline docs](http://inch-ci.org/github/AdarshRevankar/Desktop-Simulator.svg?branch=master)](http://inch-ci.org/github/AdarshRevankar/Desktop-Simulator)
3+
[![Build Status](https://travis-ci.org/AdarshRevankar/Desktop-Simulator.png?branch=master)](https://travis-ci.org/AdarshRevankar/Desktop-Simulator)
4+
[![HitCount](http://hits.dwyl.com/AdarshRevankar/Desktop-Simulator.svg)](http://hits.dwyl.com/AdarshRevankar/Desktop-Simulator)
5+
26
OpenGL project which consists of 3D environment, to demonstrate assembly and disassembly of desktop parts. This uses basic glut library to construct a 3D Scene of CPU and it's components.
37

4-
# Demonstration - Youtube
5-
https://youtu.be/VInynN3uoLo
8+
![Desktop-Simulator-Logo](https://user-images.githubusercontent.com/48080453/79739766-4220f300-831c-11ea-9873-8991e212f4cb.png)
9+
10+
---
11+
#### Demonstration - Youtube
12+
```https://youtu.be/VInynN3uoLo```
13+
14+
---
15+
#### Screenshots
16+
17+
<div style="align-items: center">
18+
Initial View
19+
20+
<img src="https://user-images.githubusercontent.com/48080453/60199807-5a41f600-9862-11e9-849c-9f65a8638e0d.png" width="100%" alt="initial view of system" style="max-height: 100px;"/>
21+
22+
CPU View
23+
24+
<img src="https://user-images.githubusercontent.com/48080453/60199855-73e33d80-9862-11e9-9d0f-3606fbb0bbb8.png" width="100%" alt="cpu view" style="max-height: 100px;"/>
625

7-
# Screenshots
8-
> Inital View
9-
![Inital View of System](https://user-images.githubusercontent.com/48080453/60199807-5a41f600-9862-11e9-849c-9f65a8638e0d.png)
10-
> CPU View
11-
![CPU Cabinet](https://user-images.githubusercontent.com/48080453/60199855-73e33d80-9862-11e9-9d0f-3606fbb0bbb8.png)
12-
> Desktop View
13-
![Desktop](https://user-images.githubusercontent.com/48080453/60199856-73e33d80-9862-11e9-850e-467f089f63cc.png)
26+
Desktop View
1427

15-
# Setup Project
28+
<img src="https://user-images.githubusercontent.com/48080453/60199856-73e33d80-9862-11e9-850e-467f089f63cc.png" width="100%" alt="desktop" style="max-height: 100px;"/>
29+
</div>
30+
31+
---
32+
33+
#### Setup Project
1634
1. Setup the project with required OpenGL headerfiles in your IDE (refer this - [Visual Studio](https://www.youtube.com/watch?v=k9LDF016_1A) or [CodeBlocks](https://www.youtube.com/watch?time_continue=79&v=Le4ub4apbn0)).
1735
2. Copy all required __header files & data files__ the project.
1836
3. Run the project. `main.cpp`
1937

2038
> **Note**: BMP Image Error - `parameter.h` change _BMP images_ path to either **Relative** to project *( Currently )* or **Absolute** *( if error occurs )*
39+
40+
---
2141

22-
# Controls
42+
#### Controls
2343
- `Up Arrow` - Move Forwards
2444
- `Down Arrow` - Move Backwords
2545
- `Left Arrow` - Move Left Side
@@ -29,21 +49,29 @@ https://youtu.be/VInynN3uoLo
2949
- `Backspace` - Assemble components
3050
- `Mouse Hover` - Change Camera View & Rotate Person
3151

32-
# Requirements
52+
---
53+
54+
#### Requirements
3355
- IDE ( *Visual Studio / CodeBlocks* )\*
3456
- basic C++ Libraries
3557
- glut.h ( freeglut.h )
3658

37-
# References
59+
---
60+
61+
#### References
3862
1. Basic 3D World Setup - [lighthouse3d.com](http://www.lighthouse3d.com/tutorials/glut-tutorial/).
3963
2. Basic OpenGL function's introduction - [khronos.org](https://www.khronos.org/).
4064
3. Texture Mapping - [youtube.com](https://www.youtube.com/watch?v=Eh0HeTCCgnE&t=452s).
4165
4. Textbook for understanding structure of OpenGL - [Computer Graphics With OpenGL - Donald Hearn & Pauline Baker](https://doc.lagout.org/programmation/OpenGL/Computer%20Graphics%20with%20OpenGL%20%284th%20ed.%29%20%5BHearn%2C%20Baker%20%26%20Carithers%202013%5D.pdf).
4266

43-
# Project Report
67+
---
68+
69+
#### Project Report
4470
> [Project Report](https://github.com/AdarshRevankar/GRAPHICAL-SIMULATION-OF-DESKTOP-AND-ITS-COMPONENTS/files/3331188/Report_GSDC.pdf) with detailed structure of project.
4571
46-
# Questions
72+
---
73+
74+
#### Questions
4775
Mail / Facebook messages can be done
4876
* [Adarsh Revankar](https://www.facebook.com/adarsh.revankar.3) - `adarsh_revankar@live.com`
4977
* [Akshaya Ram](https://www.facebook.com/akshaya.muthuraman) - `akshayaram004@gmail.com`

bin/Debug/Desktop-Simulation.exe

1.11 MB
Binary file not shown.

bin/Release/Desktop-Simulation.exe

604 KB
Binary file not shown.

bmpLoader.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <windows.h>
55
#include <GL/glut.h>
6+
#include <stdio.h>
67

78
class BmpLoader {
89
private:FILE* file;
@@ -16,7 +17,7 @@ public: unsigned char* data; // Contains Image pixel info.
1617
BmpLoader::BmpLoader(const char* filename)
1718
{
1819
iWidth = 0, iHeight = 0;
19-
fopen_s(&file, filename, "rb");
20+
file = fopen(filename, "rb");
2021
if (file == NULL) {
2122
printf("ERROR : BITMAP LOAD - File not found : File = %s\n", filename);
2223
exit(0);
@@ -70,4 +71,4 @@ BmpLoader::~BmpLoader()
7071
{
7172
delete[] data;
7273
}
73-
#endif BMPLOADER_H
74+
#endif BMPLOADER_H

data/Desktop-Simulator-full.png

95.4 KB
Loading

data/Desktop-Simulator-small.png

27.2 KB
Loading

0 commit comments

Comments
 (0)