251 Commits
0.0.13 ... r277

Author SHA1 Message Date
andreja6
b18ebfb56f Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-10-22 12:16:53 -07:00
andreja6
eade3d8e93 Fixed deselect on rotate 2018-10-22 12:16:50 -07:00
MusicalProgrammer
ccf440a65e _redraw(HWND) is now just _redraw() 2018-10-22 15:02:44 -04:00
DirtPiper
551a0e4b9e more propertygrid testing 2018-10-22 14:50:23 -04:00
DirtPiper
4afe95ae26 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-10-22 14:25:26 -04:00
DirtPiper
c6151b58e2 zip 2018-10-22 14:25:25 -04:00
andreja6
6f91ad5881 Added required H and CPP files to VCProj 2018-10-22 11:24:42 -07:00
MusicalProgrammer
09d9af492f PropertyGrid successfully implemented. 2018-10-22 14:19:51 -04:00
DirtPiper
bd37f8e22d tab 2018-10-22 14:00:31 -04:00
DirtPiper
c5485fbf55 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-10-22 13:07:07 -04:00
DirtPiper
f02272976a a bunch of nothing 2018-10-22 13:07:05 -04:00
andreja6
0b9429d1bd Fixed icon 2018-10-22 09:54:08 -07:00
DirtPiper
43e606f08e Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-10-22 12:39:10 -04:00
DirtPiper
8fd2cb8f68 spaces 2018-10-22 12:39:08 -04:00
andreja6
a19103c896 Made property grid tool window 2018-10-22 09:34:53 -07:00
DarkKnight64
06660a9f46 erik was born in 1967, not 1969 2018-10-22 17:31:11 +01:00
DarkKnight64
aa1c2df26c Readme 2018-10-22 17:29:53 +01:00
DirtPiper
03d696a8fa test failed 2018-10-22 10:57:14 -04:00
andreja6
240b342870 Made minimize and maximize hide 2018-10-22 06:58:15 -07:00
DirtPiper
ef9e6c798b Added Dependencies 2018-10-22 09:49:34 -04:00
MusicalProgrammer
a29c59f8d2 Property Grid added, but not showing yet 2018-10-21 23:25:10 -04:00
andreja6
aa2e62d2b5 Fixed memory leak 2018-10-21 19:30:21 -07:00
andreja6
19f125dcc6 Made propertygrid work, added enums yet again 2018-10-21 19:19:00 -07:00
DirtPiper
0f3ccb8045 readded the enums
yeet
2018-10-21 22:11:28 -04:00
andreja6
2134c66124 Tried to add property grid 2018-10-21 18:25:42 -07:00
DirtPiper
5806b48bae Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-10-21 21:09:52 -04:00
DirtPiper
507b0a9ace New Enums
All 05-era enums added (might be more, idk tbh)
2018-10-21 21:09:49 -04:00
andreja6
679dbe69b8 Attempted a thing 2018-10-21 17:30:38 -07:00
andreja6
4f766d8617 wat 2018-10-21 17:00:00 -07:00
andreja6
90e74e5133 Duplicate works! 2018-10-21 16:11:31 -07:00
andreja6
1c9b93d6ab Hm 2018-10-21 16:07:47 -07:00
andreja6
5eafaa401a NOT a good solution 2018-10-21 16:05:14 -07:00
andreja6
e0ba49a03c Attempted to make duplicate 2018-10-21 15:36:17 -07:00
andreja6
2725f6da58 Removed terrible instance type check, added dynamic casting 2018-10-21 13:44:53 -07:00
andreja6
8985579159 Made selected a vector 2018-09-18 19:24:12 -07:00
andreja6
c03160c3fd Did a test and failed, removed reference to ATL 2018-09-18 18:43:23 -07:00
andreja6
9193dfcabb Disabled textures 2018-08-08 17:35:24 -07:00
scottbeebiwan
c4df4131df hopefully fixed navigation canceled problems on xp, added all files to vcproj/sln, webbrowser error shows "placeholder crash" as title instead of just the name 2018-07-07 18:23:01 -07:00
MusicalProgrammer
374d3d3627 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-07-07 20:55:46 -04:00
MusicalProgrammer
fe65f8945c IEBrowser class added 2018-07-07 20:55:18 -04:00
scottbeebiwan
db4c46cf20 WHAT ARE YOU DOING
IM TAKING A PIIIIISSS
IM AN ENEMY YOUR SUPPOSED TO JUMP AT ME MOTHERFOCKUR
2018-07-07 13:09:20 -07:00
andreja6
c00e52a9e2 Fixed message 2018-07-07 12:57:00 -07:00
andreja6
c65ac42d64 OMFG 2018-07-07 12:56:06 -07:00
andreja6
95d041bf5e Fixed string 2018-07-07 12:54:27 -07:00
scottbeebiwan
89d2d0b981 did you know im fucking stupid 2018-07-07 12:53:50 -07:00
scottbeebiwan
0417060c1b *someone somehow undid commit 341866b god dman it* 2018-07-07 12:50:05 -07:00
andreja6
e7ea4c4b72 It compiles 👍 2018-07-07 12:46:28 -07:00
andreja6
bbab248209 l i n k e r e r r o r s 2018-07-07 12:41:08 -07:00
andreja6
4401fb8773 Thing that sorta kinda works 2018-07-07 12:39:31 -07:00
scottbeebiwan
3bbfeae228 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-07-07 12:12:12 -07:00
scottbeebiwan
4bb2098fe1 ignore desktop.ini 2018-07-07 12:11:45 -07:00
andreja6
ee1258b177 help 2018-07-07 12:07:32 -07:00
scottbeebiwan
341866b8bb placeholderName now shows on failed to create hwnd screen instead of "Hypercube" 2018-07-07 01:01:51 -07:00
andreja6
dae6dd5390 Failed miserably at external functions 2018-07-06 22:38:27 -07:00
MusicalProgrammer
03fd38aaa7 IWebBrowser2 added and is functional. 2018-07-06 19:23:52 -04:00
andreja6
f99d18f6ae Added AX 2018-07-06 12:42:03 -07:00
andreja6
a47268830b Added web browser variable 2018-07-06 11:48:25 -07:00
scottbeebiwan
838f69944e un-break my commit,
make a easy way to change placeholder name
2018-07-05 21:02:37 -07:00
scottbeebiwan
c6d6c3fd40 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-07-05 20:49:28 -07:00
andreja6
bf946ead54 Changed placeholder name to another placeholder name 2018-07-05 20:02:51 -07:00
scottbeebiwan
2a2d6a777b Keyboard camera controls.
Comma: Pan Left
Period: Pan Right
I: Zoom in
O: Zoom out
2018-07-05 18:06:27 -07:00
MusicalProgrammer
5c90258546 Quick initialization fix. Small mouse bug fixed too. 2018-06-12 14:24:14 -04:00
andreja6
018c4a1557 Added basic textures for now 2018-06-10 21:02:38 -07:00
andreja6
0bd49da8f4 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-06-10 20:26:46 -07:00
andreja6
1926dfa686 Added surfaces 2018-06-10 20:26:33 -07:00
andreja6
1c337b0cdc test 2018-06-05 00:00:59 -07:00
andreja6
54b19ba659 Added "Oh No!" to test gitlab 2018-06-04 23:55:55 -07:00
MusicalProgrammer
336b978fd3 Disabled editing inside the ComboBox. 2018-06-04 23:01:45 -04:00
MusicalProgrammer
90c609d06d Child windows added. 2018-06-04 22:58:20 -04:00
andreja6
22e018e138 replaced DLL 2018-06-04 08:52:35 -07:00
andreja6
a676a44fea updated VCPROJ 2018-06-02 21:30:56 -07:00
MusicalProgrammer
cd7785ce06 Bye bye GApp. We need more control. 2018-06-02 21:27:10 -04:00
MusicalProgrammer
fb3513c6f6 WindowFunctions.cpp added for annoyingly long win32 stuff. 2018-06-02 19:22:01 -04:00
andreja6
0cf7813bea Made mouse cursor not flicker 2018-06-02 15:24:32 -07:00
andreja6
39f68e1acc Removed many useless variables 2018-06-02 14:54:15 -07:00
MusicalProgrammer
be124fff75 Merge pull request #22 from andreja6/MusicalProgrammer
Fixed a camera zooming bug.
2018-06-02 16:37:34 -04:00
MusicalProgrammer
db9e030b53 Fixed a camera zooming bug. 2018-06-02 16:29:34 -04:00
MusicalProgrammer
b1a7aac481 Merge pull request #21 from andreja6/MusicalProgrammer
Musical programmer
2018-06-02 15:21:02 -04:00
MusicalProgrammer
e03a438169 Cleaned up old code. 2018-06-02 15:16:58 -04:00
MusicalProgrammer
f934a3fa38 Merge branch 'master' into MusicalProgrammer 2018-06-02 15:08:49 -04:00
andreja6
8f72e8e666 Removed inner border on 9x machines 2018-06-02 12:06:19 -07:00
MusicalProgrammer
da9d64c56f Big camera improvements. 2018-06-02 15:04:52 -04:00
andreja6
e5f7c7d1cc Fixed mouse down issues on buttons
Bypassed isHolding(VK_LBUTTON) with (GetKeyState(VK_LBUTTON) & 0x100) != 0; temporarily
2018-06-01 23:23:28 -07:00
andreja6
08b4d062e9 Added todo comment 2018-06-01 23:10:22 -07:00
andreja6
a8bfa1b4cd No longer pushing and poping state for each button drawn 2018-06-01 23:07:00 -07:00
andreja6
312ea44922 Made rendering slightly more efficient (Draw::Box is really not effective) 2018-06-01 23:04:06 -07:00
andreja6
6accc7e366 fixed vcproj 2018-06-01 19:28:37 -07:00
andreja6
f16d626f0d Merge pull request #20 from andreja6/MusicalProgrammer
Musical programmer
2018-06-01 18:46:43 -07:00
MusicalProgrammer
636d39bd2d Final cleanup 2018-06-01 21:35:32 -04:00
MusicalProgrammer
6730ddc7bc Pan and tilt restored. 2018-06-01 20:53:57 -04:00
MusicalProgrammer
b66d676254 Custom unstable camera added. 2018-06-01 19:16:50 -04:00
MusicalProgrammer
a6eb176ec3 Fixed cursor displacement issues, and stopped ClipCursor from firing. 2018-05-31 21:23:15 -04:00
MusicalProgrammer
8816e96ba3 Mouse hover, and part selection is now functional. 2018-05-31 19:59:17 -04:00
MusicalProgrammer
5aaf134ba8 GUI Mouse clicks now functional. 2018-05-31 19:27:07 -04:00
MusicalProgrammer
66391f69c4 Various user input functions added. 2018-05-31 19:13:08 -04:00
MusicalProgrammer
b40a2559f6 App class removed. It's no longer used. 2018-05-31 15:09:07 -04:00
MusicalProgrammer
741f4eaf14 Merge branch 'master' into MusicalProgrammer 2018-05-31 14:12:17 -04:00
andreja6
be7e532ead Merge pull request #19 from andreja6/dialogs
Literally did nothing even close to dialogs
2018-05-30 22:04:05 -07:00
MusicalProgrammer
72954be880 3D Viewport resizing added. (Resizes very smooth!) 2018-05-30 23:47:01 -04:00
MusicalProgrammer
a16953c8a0 Keyboard Controls changed to Win32 API. 2018-05-30 22:42:48 -04:00
MusicalProgrammer
b2c0fb58da Changed SDL Window to Win32Window. 2018-05-30 21:46:53 -04:00
MusicalProgrammer
828c0dcb41 Merge branch 'master' into MusicalProgrammer 2018-05-30 21:19:46 -04:00
MusicalProgrammer
cd0f1617cb Revert "Polishing panning"
This reverts commit 2bdef97edf.
2018-05-30 20:47:05 -04:00
andreja6
2607fc8551 Exit on alt+f4 rather than ESC 2018-05-03 12:13:14 -07:00
andreja6
1de2fb6811 Set controls to UHJK 2018-05-03 11:41:08 -07:00
andreja6
c84a2173c8 Removed repeat function 2018-05-03 11:09:45 -07:00
andreja6
c38ede1bd1 Added message functions to DataModel 2018-05-02 19:59:49 -07:00
andreja6
0f609662bb Literally nothing changed 2018-05-02 19:12:41 -07:00
andreja6
512655b448 Changed spacing 2018-05-02 17:10:29 -07:00
andreja6
4fea98467d Added versioning 2018-05-02 17:09:18 -07:00
andreja6
29dad6bd8d Cleaned up useless code and comments 2018-05-02 17:04:36 -07:00
andreja6
e04f53c071 Changed how buttons render 2018-05-02 16:47:14 -07:00
willemsteller
4b580ef5ad Added part dragging 2018-05-02 09:47:53 +02:00
andreja6
5232d5e97f No longer exit on audio failure 2018-05-01 23:56:32 -07:00
andreja6
011d817321 Merge pull request #18 from andreja6/datamodel-V1
Finished Datamodel v1
2018-05-01 21:44:04 -07:00
andreja6
60c7a386f0 Changed how selection boxes work 2018-05-01 21:43:18 -07:00
andreja6
3ee06b6c62 Made guiroot a child of datamodel 2018-05-01 21:00:46 -07:00
andreja6
57b407c894 Made timer and score a part of Workspace 2018-05-01 20:10:52 -07:00
andreja6
9999eb62e4 Changed how render works 2018-05-01 19:58:58 -07:00
andreja6
930aee06dc Finished new datamodel
Not very efficient, but its somewhere
2018-05-01 15:02:04 -07:00
andreja6
e6ca1cd502 changed AudioPlayer::PlaySound() to AudioPlayer::playSound() 2018-05-01 12:14:54 -07:00
andreja6
c875454b40 Created bare workspace and datamodel classes 2018-05-01 11:47:23 -07:00
andreja6
388962a5e7 Finished base for new datamodel 2018-05-01 11:33:24 -07:00
andreja6
9986f2ee5f Made class name getter, can not be set outside of class 2018-04-30 21:43:02 -07:00
andreja6
529821ab9f Made size getters and setters 2018-04-30 18:05:14 -07:00
andreja6
d72d09f95d Merge pull request #17 from Zmxhawrhbg/master
add a build instructions page
2018-04-30 11:31:01 -07:00
zmxhawrhbg
d810c213f6 remove linkes 2018-04-30 11:27:53 -07:00
MusicalProgrammer
2bdef97edf Polishing panning 2018-04-30 12:02:52 -04:00
zmxhawrhbg
ce66ec6f5d do some stuff to the file
now it can properly exist
2018-04-30 08:23:18 -07:00
MusicalProgrammer
df5076e90f Pan left added. Whoops 2018-04-30 11:22:25 -04:00
zmxhawrhbg
faaa59f58b add some sort of building instructions 2018-04-30 08:12:30 -07:00
MusicalProgrammer
78ece8c2a2 Panning done? 2018-04-30 11:04:05 -04:00
andreja6
8dff73d5f5 added test squares to resize and arrows 2018-04-30 01:07:23 -07:00
andreja6
4bdb1d6939 Changed how panning works 2018-04-29 23:55:53 -07:00
MusicalProgrammer
59510383e6 What I have thus far
Camera panning still needs work.
2018-04-29 23:47:40 -04:00
andreja6
f0f16a3a69 Tried changing how window starts 2018-04-29 20:00:00 -07:00
andreja6
09c6a73e80 Made rotation closer to real 2018-04-29 18:58:22 -07:00
andreja6
3108021007 Made part selection better 2018-04-29 18:33:13 -07:00
andreja6
fa3a0f9aa4 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-04-29 16:31:14 -07:00
MusicalProgrammer
f45e8afb37 Quick part selection fix
A Part in front of the camera can now be selected if other parts are behind it.
2018-04-29 18:49:57 -04:00
andreja6
739f116895 Added rotate sound
Next required thing: Collision check
2018-04-29 12:00:30 -07:00
andreja6
f281103ca1 Rotation and Selection 2018-04-29 11:40:35 -07:00
andreja6
b7d14dcf2a Added part selection 2018-04-29 01:54:02 -07:00
andreja6
5659a1e13c Changed README.md 2018-04-28 23:26:17 -07:00
andreja6
fb48c4d85d Changed how camera pan works 2018-04-28 23:22:54 -07:00
andreja6
ce3ca419e8 Merge pull request #16 from andreja6/duplicate-button
Duplicate button
2018-04-28 20:18:05 -07:00
andreja6
c3b9e1f6c8 Removed unnecessary code 2018-04-28 20:16:48 -07:00
andreja6
9ba0db1ab9 semi-working pan right 2018-04-28 20:09:51 -07:00
andreja6
70d9aded42 Attempted pan left, what
Camera makes no sence
2018-04-28 19:57:51 -07:00
andreja6
a99f58b62f "Delete" key also deletes 2018-04-27 15:27:02 -07:00
andreja6
fcb1ad05fd Changed how boxes are rendered
PhysicalInstance now has a getBox() method that returns a Box the same way it would have been rendered, also added is a getCFrameRenderBased() which returns the CFrame that would have been used in the render pass
2018-04-27 15:05:51 -07:00
DarkKnight64
50f8c7ec10 create README 2018-04-27 20:28:40 +01:00
andreja6
4094631f30 Made most fake buttons actual buttons 2018-04-27 12:19:49 -07:00
andreja6
1cae1135b9 Merge pull request #15 from andreja6/sound
Added sound and sound effects
2018-04-27 09:19:54 -07:00
andreja6
f78ca49ec0 Added try/catch 2018-04-27 09:18:48 -07:00
andreja6
e9c7607a4b Added init check 2018-04-27 00:04:04 -07:00
andreja6
6d49e266dd Made AudioPlayer's play and init method static 2018-04-26 21:41:07 -07:00
andreja6
78cdb01ef1 changed how bitrate is set 2018-04-26 21:28:22 -07:00
andreja6
1ed434c858 removed useless arial fonts 2018-04-26 20:11:36 -07:00
andreja6
f4acbaacdc Added camera click 2018-04-26 20:07:19 -07:00
andreja6
e777f3ccc4 Added sound system
Added delete sound
2018-04-26 20:01:37 -07:00
andreja6
9e61c9e4d2 Fixed bad operator 2018-04-26 13:36:57 -07:00
andreja6
3fb730ceba Merge pull request #14 from andreja6/raycasting-part-selection
Added delete functionality
2018-04-26 13:35:15 -07:00
andreja6
811ac871a3 Added delete functionality 2018-04-26 11:57:04 -07:00
andreja6
54ed0299c0 Merge pull request #13 from andreja6/bevels
Bevels
2018-04-26 11:18:28 -07:00
andreja6
09fcd72e43 Changed shade mode 2018-04-26 11:17:54 -07:00
andreja6
0371836dc8 Attempted to make bevel code 2018-04-26 11:15:41 -07:00
andreja6
74e423e9f8 Added code to unlock mouse on message box 2018-04-25 21:32:28 -07:00
andreja6
9868937c08 Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-04-25 14:39:04 -07:00
andreja6
5c500859a3 Removed dialog test on 'U' 2018-04-25 14:38:55 -07:00
andreja6
1274a8deca Merge pull request #12 from andreja6/buttons
Added button listeners, added some buttons, Made window use HWND rather than SDL
2018-04-25 14:36:03 -07:00
andreja6
4bbd82b715 Merge pull request #11 from andreja6/window
Now uses HWND rather than an SDL Window
2018-04-25 14:35:21 -07:00
andreja6
827e610b8c Added selected in button class
Basically active, it will probably be renamed
2018-04-25 14:34:27 -07:00
andreja6
10f3a25c54 Changed how selection boxes are rendered 2018-04-25 14:17:33 -07:00
andreja6
e650d4afbc Removed useless images 2018-04-25 05:58:33 -07:00
andreja6
d738a804e6 Changed some images, Added camera button listeners 2018-04-24 22:00:46 -07:00
andreja6
1f7c5b28f8 Test of forward button 2018-04-24 20:24:34 -07:00
andreja6
a9d533e447 YAY 2018-04-24 19:35:53 -07:00
andreja6
a9f91c8a9e Changed how window works
Controls now work
2018-04-24 19:17:49 -07:00
andreja6
04f1ac813e Controller still broken but window size works 2018-04-24 19:02:48 -07:00
andreja6
2b2672b9fd Now resizes with hwnd
but controls are dead asgassdsad
2018-04-24 18:23:07 -07:00
andreja6
d0bba08f3a Controlls dont work 2018-04-24 18:11:29 -07:00
andreja6
3f222b75d8 Tried adding dialog and main window 2018-04-24 18:01:26 -07:00
andreja6
560245e005 Im not sure what changed 2018-04-24 17:20:04 -07:00
andreja6
cbd680a6ac Changed the way blocks are rendered 2018-04-24 17:13:04 -07:00
andreja6
f6b301a836 Added click listener to TextButton 2018-04-24 12:44:24 -07:00
andreja6
d1a1ebd016 Added mouse click functions to image button
Added destructor for images
Deleting listener now on exit
2018-04-24 12:39:53 -07:00
andreja6
9ffe37c21a Fixed issue with disabled images 2018-04-24 00:59:03 -07:00
andreja6
30aa99ff0b Changed how the scale disabled icon looks 2018-04-24 00:35:57 -07:00
andreja6
3ee0075f1d Added scale tool image 2018-04-24 00:34:34 -07:00
andreja6
05da8e2270 Added "disabled" bool to button
Changed null check
2018-04-23 23:40:58 -07:00
andreja6
68ac692314 Added final GUI components 2018-04-23 23:25:06 -07:00
andreja6
a4176510b9 Changed class organization 2018-04-23 22:05:41 -07:00
andreja6
55e890bdc1 Made BaseButton class
Buttons now children of BaseButton
Buttons now render over and down modes
Text buttons now exist
Buttons render differently
2018-04-23 22:02:12 -07:00
andreja6
98d3358fd5 Added resize, cursor, and arrows mode
Added selection box rendering
Added arrow rendering
added resize rendering
2018-04-23 20:09:01 -07:00
andreja6
68edb442d3 Mouse now stays where you left it 2018-04-23 17:53:41 -07:00
andreja6
20e8c63d5c Changed how the camera works
Added arrow key controlled camera
Removed WASD camera movement
FPS is now locked to 30 Frames P/S
Mouse wheel now moves the camera
2018-04-23 17:51:03 -07:00
andreja6
5d8e4bc040 Merge pull request #10 from andreja6/HWND
Hwnd
2018-04-23 14:09:23 -07:00
andreja6
71cf1e39f3 Delete stdafx.h 2018-04-23 21:09:05 +00:00
andreja6
21be7a4c73 Delete Work.cpp 2018-04-23 21:08:08 +00:00
andreja6
e7df4b26f0 Merge pull request #8 from andreja6/dialogui
Added test dialog
2018-04-23 14:04:41 -07:00
andreja6
11788fa37c Changed the way controllerflags are rendered, they work now 2018-04-23 11:35:02 -07:00
andreja6
e29ad28a06 Test of hover text 2018-04-22 23:32:36 -07:00
andreja6
9d30c2aed7 Tried doing stuff with fonts 2018-04-22 22:52:50 -07:00
andreja6
c62df67db2 Changed default DataModel name to "undefined" 2018-04-22 21:09:43 -07:00
andreja6
c9e997c794 Added mouse cursors 2018-04-22 20:44:29 -07:00
andreja6
8a6d7d0d8d added new line 2018-04-22 19:57:12 -07:00
andreja6
6cea4397f2 Changed window to SDL, can now access bare HWND component 2018-04-22 19:51:14 -07:00
andreja6
f0fffa71d4 Tried something 2018-04-22 15:05:45 -07:00
andreja6
49c117d5d7 Removed MFC 2018-04-22 12:32:37 -07:00
andreja6
19913cb665 Added base class for button listening
Fixed a few memory leaks
2018-04-20 18:55:55 -07:00
andreja6
810488e20c Added test dialog 2018-04-20 06:59:37 -07:00
andreja6
a91bc4c5b5 Reverted to old sln 2018-04-19 22:26:57 -07:00
andreja6
45e28f96dc Merge branch 'master' of https://github.com/andreja6/G3D-Fun 2018-04-19 21:57:29 -07:00
andreja6
b521f1c86f Fixed solution 2018-04-19 21:57:26 -07:00
andreja6
1d4082bdd0 Merge pull request #7 from andreja6/guiinstance
Fixed names
2018-04-19 21:45:04 -07:00
andreja6
df6cee3e11 Fixed names 2018-04-19 21:44:30 -07:00
andreja6
15e1868fc2 Merge pull request #6 from andreja6/guiinstance
Merge Guiinstance
2018-04-19 21:42:11 -07:00
andreja6
113115b6df Changed the way releases compile 2018-04-19 21:41:03 -07:00
andreja6
2445d076a1 Reset Solution 2018-04-19 21:36:31 -07:00
andreja6
8fc8549a6c Added deprication notice to debug mode 2018-04-19 20:42:11 -07:00
andreja6
bb3aac25c5 put drawButton in its class, and not in main loop 2018-04-19 20:30:30 -07:00
andreja6
09fa95d4a0 Added dialog 2018-04-19 19:40:15 -07:00
andreja6
acd87e351b Made test work on offset 2018-04-19 18:17:19 -07:00
andreja6
8d53e8ff0f Removed useless debug comments and code 2018-04-19 18:07:48 -07:00
andreja6
b900e918b4 Converted most menu buttons to TextButton, No longer hard coded
Removed useless values
MUCH faster now!
2018-04-19 18:03:12 -07:00
andreja6
067a744cda Changed className TextButtonInstance to TextButton to match naming convention 2018-04-19 17:19:02 -07:00
andreja6
3e4c128347 Added bare bones TextButton rendering
(Yes, it took that many lines of code)
2018-04-19 17:18:26 -07:00
andreja6
acbe509c05 Fixed errors
Changed bit depth
2018-04-19 00:15:16 -07:00
andreja6
1bb0c6eb6f Removed broken image 2018-04-18 23:56:10 -07:00
andreja6
8889494848 Removed unneded font 2018-04-18 23:55:21 -07:00
andreja6
8a780d6f0b Added some images 2018-04-18 23:53:32 -07:00
andreja6
0a2b508290 Added down state
-Added mouse down state
-Commented out useless function
-Added temporary default value to ovr_id
-Added temporary images go_dn and go_dn_id
-Removed debug spacing increase and decrease key press code (causes crashes by design and was useless)
2018-04-18 22:50:31 -07:00
andreja6
33e3aeb16e Commented out useless function 2018-04-18 20:42:15 -07:00
andreja6
4526fa68df Added mouseover testing, will be moved to instances 2018-04-18 20:39:36 -07:00
andreja6
acfd499cfb GO BUTTON TEXTURE!
YES!
2018-04-18 19:56:48 -07:00
andreja6
b12c753179 Added visible and float booleans 2018-04-13 20:09:20 -07:00
andreja6
7d623bb99d Added Over and Out options on text buttons 2018-04-13 14:14:35 -07:00
andreja6
21684a6ea3 Added properties to TextButtonInstance
Why wont the go button become textured aaaaaaaaaaaaaaaa
2018-04-12 22:44:51 -07:00
andreja6
5306ec6809 Fixed include issues 2018-04-12 19:25:17 -07:00
andreja6
fe2f8cf160 Added GUI instances
Added toolbox dialog
TODO: Port GUI buttons to instances
2018-04-12 18:25:17 -07:00
mario64crashed@gmail.com
36999b0307 Add toolbox images
from http://roblox.com/UI/Imags/
2018-04-12 19:31:10 +01:00
andreja6
f4d01e48fa Merge pull request #5 from andreja6/ui
Merged to wrong branch
2018-04-12 11:04:02 -07:00
andreja6
0816390509 Merge pull request #3 from DarkKnight64/master
delete most of the fonts we don't need
2018-04-12 11:00:27 -07:00
andreja6
9ce3a1a26c Merge pull request #4 from andreja6/ui
Merge UI
2018-04-12 11:00:00 -07:00
mario64crashed@gmail.com
2797bdb4a5 delete most of the fonts we don't need
kept arial because it's pretty common and the fonts we already have
(dominant/light-trek, which is actually Eras Demi ITC or something)
2018-04-12 11:32:34 +01:00
andreja6
ce7b221a11 im not sure what changed but ok 2018-04-11 14:43:15 -07:00
andreja6
2776546ab7 Added about screen template 2018-04-11 14:03:33 -07:00
andreja6
49013a7da8 Removed test dialog 2018-04-11 11:50:13 -07:00
andreja6
ede16aa880 Created dialogs resource 2018-04-11 11:49:48 -07:00
andreja6
7fad41ff53 Removed CLR due to crashing 2018-04-11 11:16:41 -07:00
158 changed files with 9708 additions and 888 deletions

3
.gitignore vendored
View File

@@ -50,3 +50,6 @@ log.txt
*.suo *.suo
G3DTest.suo G3DTest.suo
G3DTest.suo G3DTest.suo
stderr.txt
desktop.ini
main.cpp

4
ActionType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef ACTIONTYPE_H
#define ACTIONTYPE_H
static enum ActionType {Nothing, Pause, Lose, Draw, Win};
#endif

4
AffectType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef AFFECTTYPE_H
#define AFFECTTYPE_H
static enum AffectType {NoChange, Increase, Decrease};
#endif

112
AudioPlayer.cpp Normal file
View File

@@ -0,0 +1,112 @@
#include "AudioPlayer.h"
#include "SDL.h"
#include "SDL_audio.h"
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#define NUM_SOUNDS 10
static SDL_AudioSpec fmt;
static bool initiated = false;
AudioPlayer::AudioPlayer(void)
{
}
AudioPlayer::~AudioPlayer(void)
{
SDL_CloseAudio();
}
void AudioPlayer::init()
{
initiated = true;
extern void mixaudio(void *unused, Uint8 *stream, int len);
fmt.freq = 22050;
fmt.format = AUDIO_S16;
fmt.channels = 2;
fmt.samples = 1024; /* A good value for games */
fmt.callback = mixaudio;
fmt.userdata = NULL;
/* Open the audio device and start playing sound! */
if ( SDL_OpenAudio(&fmt, NULL) < 0 ) {
fprintf(stderr, "Unable to open audio: %s\n", SDL_GetError());
}
SDL_PauseAudio(0);
}
static struct sample {
Uint8 *data;
Uint32 dpos;
Uint32 dlen;
} sounds[NUM_SOUNDS];
void mixaudio(void *unused, Uint8 *stream, int len)
{
int i;
Uint32 amount;
for ( i=0; i<NUM_SOUNDS; ++i ) {
amount = (sounds[i].dlen-sounds[i].dpos);
if ( amount > (Uint32)len ) {
amount = len;
}
SDL_MixAudio(stream, &sounds[i].data[sounds[i].dpos], amount, SDL_MIX_MAXVOLUME);
sounds[i].dpos += amount;
}
}
void AudioPlayer::playSound(std::string fileString)
{
if(initiated)
{
char *file = new char[fileString.length() + 1];
strcpy(file, fileString.c_str());
int index;
SDL_AudioSpec wave;
Uint8 *data;
Uint32 dlen;
SDL_AudioCVT cvt;
/* Look for an empty (or finished) sound slot */
for ( index=0; index<NUM_SOUNDS; ++index ) {
if ( sounds[index].dpos == sounds[index].dlen ) {
break;
}
}
if ( index == NUM_SOUNDS )
return;
/* Load the sound file and convert it to 16-bit stereo at 22kHz */
if ( SDL_LoadWAV(file, &wave, &data, &dlen) == NULL ) {
fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
return;
}
SDL_BuildAudioCVT(&cvt, wave.format, wave.channels, wave.freq,
AUDIO_S16, 2, fmt.freq);
cvt.buf = (Uint8*)malloc(dlen*cvt.len_mult);
memcpy(cvt.buf, data, dlen);
cvt.len = dlen;
SDL_ConvertAudio(&cvt);
SDL_FreeWAV(data);
/* Put the sound data in the slot (it starts playing immediately) */
if ( sounds[index].data ) {
free(sounds[index].data);
}
SDL_LockAudio();
sounds[index].data = cvt.buf;
sounds[index].dlen = cvt.len_cvt;
sounds[index].dpos = 0;
SDL_UnlockAudio();
delete [] file;
}
else
{
OutputDebugString("Audio player not initialized, sound will not play\r\n");
}
}

11
AudioPlayer.h Normal file
View File

@@ -0,0 +1,11 @@
#include <G3DAll.h>
#pragma once
class AudioPlayer
{
public:
AudioPlayer(void);
~AudioPlayer(void);
static void playSound(std::string);
static void init();
};

60
BaseButtonInstance.cpp Normal file
View File

@@ -0,0 +1,60 @@
#include "BaseButtonInstance.h"
#include "Globals.h"
bool floatBottom = false;
bool floatRight = false;
bool floatCenter = false;
bool disabled = false;
bool selected = false;
ButtonListener* listener = NULL;
BaseButtonInstance::BaseButtonInstance(void)
{
listener = NULL;
}
void BaseButtonInstance::render(RenderDevice* rd)
{
DataModelInstance* dataModel = Globals::dataModel;
Vector2 pos = Vector2(dataModel->mousex,dataModel->mousey);
drawObj(rd, pos, dataModel->mouseButton1Down);
Instance::render(rd);
}
BaseButtonInstance::~BaseButtonInstance(void)
{
delete listener;
}
void BaseButtonInstance::setButtonListener(ButtonListener* buttonListener)
{
listener = buttonListener;
}
void BaseButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown){}
bool BaseButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd){return false;}
void BaseButtonInstance::onMouseClick()
{
if(listener != NULL)
{
listener->onButton1MouseClick(this);
}
}
bool BaseButtonInstance::mouseInArea(float point1x, float point1y, float point2x, float point2y, float mousex, float mousey)
{
if(mousex >= point1x && mousey >= point1y)
{
if(mousex < point2x && mousey < point2y)
{
return true;
}
}
return false;
}

24
BaseButtonInstance.h Normal file
View File

@@ -0,0 +1,24 @@
#pragma once
#include "instance.h"
#pragma once
#include "ButtonListener.h"
class ButtonListener;
class BaseButtonInstance : public Instance
{
public:
BaseButtonInstance(void);
virtual ~BaseButtonInstance(void);
virtual void render(RenderDevice* rd);
virtual void drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown);
virtual bool mouseInButton(float, float, RenderDevice* rd);
virtual void onMouseClick();
void setButtonListener(ButtonListener*);
bool floatBottom;
bool floatRight;
bool floatCenter;
bool disabled;
bool selected;
protected:
bool mouseInArea(float, float, float, float, float, float);
class ButtonListener* listener;
};

4
BinType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef BINTYPE_H
#define BINTYPE_H
static enum ActionType {GameTool, Grab, Clone, Hammer};
#endif

9
BrowserCallHandler.cpp Normal file
View File

@@ -0,0 +1,9 @@
#include "BrowserCallHandler.h"
BrowserCallHandler::BrowserCallHandler(void)
{
}
BrowserCallHandler::~BrowserCallHandler(void)
{
}

8
BrowserCallHandler.h Normal file
View File

@@ -0,0 +1,8 @@
#pragma once
#include <Mshtmhst.h>
class BrowserCallHandler : IDocHostUIHandler
{
public:
BrowserCallHandler(void);
~BrowserCallHandler(void);
};

15
ButtonListener.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "ButtonListener.h"
ButtonListener::ButtonListener()
{
}
ButtonListener::~ButtonListener(void)
{
}
void ButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{
}

20
ButtonListener.h Normal file
View File

@@ -0,0 +1,20 @@
#pragma once
#include "Demo.h"
#include "BaseButtonInstance.h"
class BaseButtonInstance;
class ButtonListener
{
public:
ButtonListener();
~ButtonListener(void);
virtual void onButton1MouseClick(BaseButtonInstance*);
//virtual void onMouseOver(); //TODO
//virtual void onMouseOut(); //TODO
//virtual void onButton1MouseDown(); //TODO
//virtual void onButton1MouseUp(); //TODO
//virtual void onButton2MouseClick(); //TODO
//virtual void onButton2MouseDown(); //TODO
//virtual void onButton2MouseUp(); //TODO
//What to do now...
};

231
CameraController.cpp Normal file
View File

@@ -0,0 +1,231 @@
#include "CameraController.h"
#include "win32Defines.h"
#include <iostream>
#include "PhysicalInstance.h"
#include "Demo.h"
#include "AudioPlayer.h"
CameraController::CameraController(){
yaw=0;
pitch=0;
moveRate=0.5f;
forwards=false;
backwards=false;
left=false;
right=false;
zoom=7.f;
rightButtonHolding=false;
focusPosition=Vector3(0,0,0);
}
GCamera* CameraController::getCamera()
{
return &g3dCamera;
}
void CameraController::lookAt(const Vector3& position) {
const Vector3 look = (position - g3dCamera.getCoordinateFrame().translation);
yaw = aTan2(look.x, -look.z);
pitch = -aTan2(look.y, distance(look.x, look.z));
CoordinateFrame frame = g3dCamera.getCoordinateFrame().translation;
frame.rotation = Matrix3::fromEulerAnglesZYX(0, -yaw, -pitch);
g3dCamera.setCoordinateFrame(frame);
}
void CameraController::setFrame(const CoordinateFrame& cf) {
Vector3 look = cf.getLookVector();
g3dCamera.setCoordinateFrame(cf);
lookAt(cf.translation + look);
focusPosition=cf.translation+cf.lookVector()*zoom;
}
CoordinateFrame CameraController::getCoordinateFrame() {
CoordinateFrame cf;
cf.translation=translation;
cf.rotation = Matrix3::fromEulerAnglesZYX(0, -yaw, -pitch);
return cf;
}
void CameraController::refreshZoom(const CoordinateFrame& frame)
{
CoordinateFrame zoomFrame = focusPosition-frame.lookVector()*zoom;
zoomFrame.lookAt(focusPosition);
setFrame(zoomFrame);
}
void CameraController::pan(CoordinateFrame* frame,float spdX, float spdY)
{
yaw+=spdX;
pitch+=spdY;
if (pitch>1.4f) pitch=1.4f;
if (pitch<-1.4f) pitch=-1.4f;
frame->translation = Vector3(sin(-yaw)*zoom*cos(pitch),sin(pitch)*zoom,cos(-yaw)*zoom*cos(pitch))+focusPosition;
frame->lookAt(focusPosition);
}
bool CameraController::onMouseWheel(int x, int y, short delta)
{
Zoom(delta);
return true;
}
void CameraController::Zoom(short delta)
{
CoordinateFrame frame = g3dCamera.getCoordinateFrame();
if (delta>0) { // Mouse wheel up
CoordinateFrame zoomFrame = frame+frame.lookVector()*(zoom/5);
zoom=(zoomFrame.translation-focusPosition).magnitude();
if (zoom>CAM_ZOOM_MIN)
{
setFrame(zoomFrame);
}
else
{
zoom=CAM_ZOOM_MIN;
refreshZoom(frame);
}
}
else {
CoordinateFrame zoomFrame = frame-frame.lookVector()*(zoom/5);
zoom=(zoomFrame.translation-focusPosition).magnitude();
if (zoom<CAM_ZOOM_MAX)
{
setFrame(zoomFrame);
}
else
{
zoom=CAM_ZOOM_MAX;
refreshZoom(frame);
}
}
}
void CameraController::panLeft()
{
CoordinateFrame frame = g3dCamera.getCoordinateFrame();
pan(&frame,toRadians(-45),0);
setFrame(frame);
}
void CameraController::panRight()
{
CoordinateFrame frame = g3dCamera.getCoordinateFrame();
pan(&frame,toRadians(45),0);
setFrame(frame);
}
void CameraController::tiltUp()
{
CoordinateFrame frame = CoordinateFrame(g3dCamera.getCoordinateFrame().rotation, g3dCamera.getCoordinateFrame().translation);
pan(&frame,0,toRadians(25));
setFrame(frame);
}
void CameraController::tiltDown()
{
CoordinateFrame frame = CoordinateFrame(g3dCamera.getCoordinateFrame().rotation, g3dCamera.getCoordinateFrame().translation);
pan(&frame,0,toRadians(-25));
setFrame(frame);
}
void CameraController::centerCamera(Instance* selection)
{
CoordinateFrame frame = CoordinateFrame(g3dCamera.getCoordinateFrame().translation);
if(selection == NULL)
{
lookAt(Vector3(0,0,0));
focusPosition=Vector3(0,0,0);
}
else
{
Vector3 partPos = ((PhysicalInstance*)selection)->getPosition()/2;
lookAt(partPos);
focusPosition=partPos;
zoom=((partPos-frame.translation).magnitude());
}
}
void CameraController::update(Demo* demo)
{
float offsetSize = 0.05F;
Vector3 cameraPos = g3dCamera.getCoordinateFrame().translation;
CoordinateFrame frame = g3dCamera.getCoordinateFrame();
bool moving=false;
if(GetHoldKeyState('U')) {
forwards = true;
moving=true;
}
if(GetHoldKeyState('J')) {
backwards = true;
moving=true;
}
if(GetHoldKeyState('H')) {
left = true;
moving=true;
}
if(GetHoldKeyState('K')) {
right = true;
moving=true;
}
if(forwards) {
forwards = false;
frame.translation += frame.lookVector()*moveRate;
}
else if(backwards) {
backwards = false;
frame.translation -= frame.lookVector()*moveRate;
}
if(left) {
left = false;
frame.translation += frame.leftVector()*moveRate;
}
else if(right) {
right = false;
frame.translation += frame.rightVector()*moveRate;
}
if (moving)
{
zoom=7;
focusPosition=frame.translation+frame.lookVector()*zoom;
}
if(rightButtonHolding) {
Globals::useMousePoint = true;
Globals::mousepoint = oldDesktopMouse;
POINT mouse;
GetCursorPos(&mouse);
pan(&frame,(mouse.x-oldDesktopMouse.x)/100.f,(mouse.y-oldDesktopMouse.y)/100.f);
SetCursorPos(oldDesktopMouse.x,oldDesktopMouse.y);
}
else
{
Globals::useMousePoint = false;
}
if(GetHoldKeyState(VK_RSHIFT) || GetHoldKeyState(VK_LSHIFT)) {
moveRate = 1;
}
else {
moveRate = 0.5;
}
if(GetHoldKeyState(VK_RBUTTON))
{
if (rightButtonHolding==false)
{
GetCursorPos(&oldDesktopMouse);
rightButtonHolding = true;
}
}
else
{
rightButtonHolding = false;
}
g3dCamera.setCoordinateFrame(frame);
}

46
CameraController.h Normal file
View File

@@ -0,0 +1,46 @@
#pragma once
#include <G3DAll.h>
#include "Instance.h"
#include "Globals.h"
#include <string>
#define CAM_ZOOM_MIN 0.1f
#define CAM_ZOOM_MAX 100.f
class Demo;
class CameraController {
public:
CameraController();
G3D::CoordinateFrame getCoordinateFrame();
void setFrame(const CoordinateFrame& cf);
void lookAt(const Vector3& position);
void refreshZoom(const CoordinateFrame& frame);
void pan(CoordinateFrame* frame,float spdX,float spdY);
void update(Demo* demo);
void centerCamera(Instance* selection);
void panLeft();
void panRight();
void tiltUp();
void tiltDown();
void Zoom(short delta);
bool onMouseWheel(int x, int y, short delta);
GCamera* getCamera();
private:
Vector3 translation;
Vector3 focusPosition;
float yaw;
float pitch;
float moveRate;
float zoom;
bool forwards;
bool backwards;
bool left;
bool right;
bool rightButtonHolding;
POINT oldDesktopMouse;
GCamera g3dCamera;
std::string cameraSound;
};

4
ControllerType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef CONTROLLERTYPE_H
#define CONTROLLERTYPE_H
static enum ControllerType {None, KeyboardRight, KeyboardLeft, Joypad1, Joypad2, Chase, Flee};
#endif

76
DataModelInstance.cpp Normal file
View File

@@ -0,0 +1,76 @@
#include "DataModelInstance.h"
WorkspaceInstance* workspace;
Instance* guiRoot;
float mousex;
float mousey;
bool mouseButton1Down;
std::string message;
bool showMessage;
G3D::GFontRef font;
DataModelInstance::DataModelInstance(void)
{
workspace = new WorkspaceInstance();
guiRoot = new Instance();
children.push_back(workspace);
className = "dataModel";
mousex = 0;
mousey = 0;
mouseButton1Down = false;
showMessage = false;
}
DataModelInstance::~DataModelInstance(void)
{
}
void DataModelInstance::setMessage(std::string msg)
{
message = msg;
showMessage = true;
}
void DataModelInstance::clearMessage()
{
showMessage = false;
message = "";
}
void DataModelInstance::drawMessage(RenderDevice* rd)
{
if(showMessage && !font.isNull())
{
int x = rd->getWidth()/2;
int y = rd->getHeight()/2;
int width = rd->getWidth()/2 + 100;
int height = width / 3;
Draw::box(Box(Vector3(x-(width/2), y-(height/2), 0), Vector3(x+(width/2), y+(height/2), 0)), rd, Color4::fromARGB(0x55B2B2B2), Color3::fromARGB(0xB2B2B2));
font->draw2D(rd, message, Vector2(x,y), height/8, Color3::white(), Color4::clear(), GFont::XALIGN_CENTER, GFont::YALIGN_CENTER);
}
}
WorkspaceInstance* DataModelInstance::getWorkspace()
{
return workspace;
}
Vector2 DataModelInstance::getMousePos()
{
return Vector2(mousex,mousey);
}
void DataModelInstance::setMousePos(int x,int y)
{
mousex=x;
mousey=y;
}
void DataModelInstance::setMousePos(Vector2 pos)
{
mousex=pos.x;
mousey=pos.y;
}
Instance* DataModelInstance::getGuiRoot()
{
return guiRoot;
}

23
DataModelInstance.h Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include "instance.h"
#include "WorkspaceInstance.h"
class DataModelInstance :
public Instance
{
public:
DataModelInstance(void);
~DataModelInstance(void);
void setMessage(std::string);
void clearMessage();
void drawMessage(RenderDevice*);
GFontRef font;
WorkspaceInstance* getWorkspace();
Instance* getGuiRoot();
float mousex;
float mousey;
Vector2 getMousePos();
void setMousePos(int x,int y);
void setMousePos(Vector2 pos);
bool mouseButton1Down;
};

57
Demo.h Normal file
View File

@@ -0,0 +1,57 @@
#pragma once
#include <G3DAll.h>
#include "CameraController.h"
#include "PropertyWindow.h"
class Demo { // : public GApp {
public:
Demo(const GAppSettings& settings,HWND parentWindow);
void Boop();
virtual ~Demo() {}
virtual void exitApplication();
virtual void onInit();
virtual void onLogic();
virtual void onNetwork();
virtual void onSimulation(RealTime rdt, SimTime sdt, SimTime idt);
virtual void onGraphics(RenderDevice* rd);
virtual void onUserInput(UserInput* ui);
virtual void onCleanup();
std::vector<Instance*> getSelection();
void run();
void QuitApp();
void resizeWithParent(HWND parentWindow);
void onCreate(HWND parentWindow);
void onKeyPressed(int key);
void onKeyUp(int key);
void onMouseLeftPressed(HWND hwnd,int x, int y);
void onMouseLeftUp(int x, int y);
void onMouseRightPressed(int x, int y);
void onMouseRightUp(int x, int y);
void onMouseMoved(int x, int y);
void onMouseWheel(int x, int y, short delta);
CameraController cameraController;
RenderDevice* renderDevice;
UserInput* userInput;
private:
void initGUI();
HWND _hWndMain;
SkyRef sky;
bool quit;
bool mouseOnScreen;
bool rightButtonHolding;
void main();
GWindow* _window;
HWND _hwndToolbox;
HWND _buttonTest;
HWND _hwndRenderer;
PropertyWindow* _propWindow;
protected:
Stopwatch m_graphicsWatch;
Stopwatch m_logicWatch;
Stopwatch m_networkWatch;
Stopwatch m_userInputWatch;
Stopwatch m_simulationWatch;
Stopwatch m_waitWatch;
};

BIN
Dialogs.aps Normal file

Binary file not shown.

84
Dialogs.rc Normal file
View File

@@ -0,0 +1,84 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""windows.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (Canada) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENC)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "icon1.ico"
#endif // English (Canada) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

BIN
G3DTest.aps Normal file

Binary file not shown.

View File

@@ -1,105 +1,105 @@
# Microsoft Developer Studio Project File - Name="G3DTest" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="G3DTest" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Application" 0x0101
CFG=G3DTest - Win32 Debug CFG=G3DTest - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "G3DTest.mak". !MESSAGE NMAKE /f "G3DTest.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "G3DTest.mak" CFG="G3DTest - Win32 Debug" !MESSAGE NMAKE /f "G3DTest.mak" CFG="G3DTest - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "G3DTest - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "G3DTest - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "G3DTest - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE "G3DTest - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "" # PROP Scc_ProjName ""
# PROP Scc_LocalPath "" # PROP Scc_LocalPath ""
CPP=cl.exe CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "G3DTest - Win32 Release" !IF "$(CFG)" == "G3DTest - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release" # PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release" # PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release" # PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release" # PROP Intermediate_Dir "Release"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x1009 /d "NDEBUG" # ADD BASE RSC /l 0x1009 /d "NDEBUG"
# ADD RSC /l 0x1009 /d "NDEBUG" # ADD RSC /l 0x1009 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "G3DTest - Win32 Debug" !ELSEIF "$(CFG)" == "G3DTest - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug" # PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug" # PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug" # PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug" # PROP Intermediate_Dir "Debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD BASE RSC /l 0x1009 /d "_DEBUG"
# ADD RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "G3DTest - Win32 Release" # Name "G3DTest - Win32 Release"
# Name "G3DTest - Win32 Debug" # Name "G3DTest - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File # Begin Source File
SOURCE=.\main.cpp SOURCE=.\main.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl" # PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group # End Group
# Begin Group "Resource Files" # Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group # End Group
# End Target # End Target
# End Project # End Project

View File

@@ -1,29 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00 Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
############################################################################### ###############################################################################
Project: "G3DTest"=.\G3DTest.dsp - Package Owner=<4> Project: "G3DTest"=.\G3DTest.dsp - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################
Global: Global:
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<3> Package=<3>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################

View File

@@ -1,32 +1,32 @@
<html> <html>
<body> <body>
<pre> <pre>
<h1>Build Log</h1> <h1>Build Log</h1>
<h3> <h3>
--------------------Configuration: G3DTest - Win32 Debug-------------------- --------------------Configuration: G3DTest - Win32 Debug--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\Users\Andreja\AppData\Local\Temp\RSPFD70.tmp" with contents Creating temporary file "C:\Users\Andreja\AppData\Local\Temp\RSPFD70.tmp" with contents
[ [
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"Debug/G3DTest.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"Debug/G3DTest.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\USERS\ANDREJA\G3D\G3DTest\main.cpp" "C:\USERS\ANDREJA\G3D\G3DTest\main.cpp"
] ]
Creating command line "cl.exe @C:\Users\Andreja\AppData\Local\Temp\RSPFD70.tmp" Creating command line "cl.exe @C:\Users\Andreja\AppData\Local\Temp\RSPFD70.tmp"
Creating temporary file "C:\Users\Andreja\AppData\Local\Temp\RSPFD71.tmp" with contents Creating temporary file "C:\Users\Andreja\AppData\Local\Temp\RSPFD71.tmp" with contents
[ [
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/G3DTest.pdb" /debug /machine:I386 /out:"Debug/G3DTest.exe" /pdbtype:sept kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/G3DTest.pdb" /debug /machine:I386 /out:"Debug/G3DTest.exe" /pdbtype:sept
.\Debug\main.obj .\Debug\main.obj
] ]
Creating command line "link.exe @C:\Users\Andreja\AppData\Local\Temp\RSPFD71.tmp" Creating command line "link.exe @C:\Users\Andreja\AppData\Local\Temp\RSPFD71.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
main.cpp main.cpp
Linking... Linking...
<h3>Results</h3> <h3>Results</h3>
G3DTest.exe - 0 error(s), 0 warning(s) G3DTest.exe - 0 error(s), 0 warning(s)
</pre> </pre>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "G3DTest", "G3DTest.vcproj", "{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "G3DTest", "G3DTest.vcproj", "{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.ActiveCfg = Debug|Win32 {6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.ActiveCfg = Debug|Win32
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.Build.0 = Debug|Win32 {6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.Build.0 = Debug|Win32
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.ActiveCfg = Release|Win32 {6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.ActiveCfg = Release|Win32
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.Build.0 = Release|Win32 {6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

Binary file not shown.

View File

@@ -1,282 +1,495 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8.00"
Name="G3DTest" Name="G3DTest"
ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}" ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
RootNamespace="G3DTest" RootNamespace="G3DTest"
> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32" Name="Win32"
/> />
</Platforms> </Platforms>
<ToolFiles> <ToolFiles>
</ToolFiles> </ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory=".\Release" OutputDirectory=".\Release"
IntermediateDirectory=".\Release" IntermediateDirectory=".\Release"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false" UseOfATL="0"
CharacterSet="2" ATLMinimizesCRunTimeLibraryUsage="false"
> CharacterSet="2"
<Tool >
Name="VCPreBuildEventTool" <Tool
/> Name="VCPreBuildEventTool"
<Tool />
Name="VCCustomBuildTool" <Tool
/> Name="VCCustomBuildTool"
<Tool />
Name="VCXMLDataGeneratorTool" <Tool
/> Name="VCXMLDataGeneratorTool"
<Tool />
Name="VCWebServiceProxyGeneratorTool" <Tool
/> Name="VCWebServiceProxyGeneratorTool"
<Tool />
Name="VCMIDLTool" <Tool
PreprocessorDefinitions="NDEBUG" Name="VCMIDLTool"
MkTypLibCompatible="true" PreprocessorDefinitions="NDEBUG"
SuppressStartupBanner="true" MkTypLibCompatible="true"
TargetEnvironment="1" SuppressStartupBanner="true"
TypeLibraryName=".\Release/G3DTest.tlb" TargetEnvironment="1"
HeaderFileName="" TypeLibraryName=".\Release/G3DTest.tlb"
/> HeaderFileName=""
<Tool />
Name="VCCLCompilerTool" <Tool
Optimization="2" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" InlineFunctionExpansion="1"
StringPooling="true" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="0" StringPooling="true"
EnableFunctionLevelLinking="true" RuntimeLibrary="2"
PrecompiledHeaderFile=".\Release/G3DTest.pch" EnableFunctionLevelLinking="true"
AssemblerListingLocation=".\Release/" PrecompiledHeaderFile=".\Release/G3DTest.pch"
ObjectFile=".\Release/" AssemblerListingLocation=".\Release/"
ProgramDataBaseFileName=".\Release/" ObjectFile=".\Release/"
WarningLevel="3" ProgramDataBaseFileName=".\Release/"
SuppressStartupBanner="true" WarningLevel="3"
/> SuppressStartupBanner="true"
<Tool />
Name="VCManagedResourceCompilerTool" <Tool
/> Name="VCManagedResourceCompilerTool"
<Tool />
Name="VCResourceCompilerTool" <Tool
PreprocessorDefinitions="NDEBUG" Name="VCResourceCompilerTool"
Culture="4105" PreprocessorDefinitions="NDEBUG"
/> Culture="4105"
<Tool />
Name="VCPreLinkEventTool" <Tool
/> Name="VCPreLinkEventTool"
<Tool />
Name="VCLinkerTool" <Tool
OutputFile=".\Release/G3DTest.exe" Name="VCLinkerTool"
LinkIncremental="1" AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib"
SuppressStartupBanner="true" OutputFile="./G3DTest.exe"
ProgramDatabaseFile=".\Release/G3DTest.pdb" LinkIncremental="1"
SubSystem="2" SuppressStartupBanner="true"
TargetMachine="1" ProgramDatabaseFile=".\Release/G3DTest.pdb"
/> SubSystem="2"
<Tool TargetMachine="1"
Name="VCALinkTool" />
/> <Tool
<Tool Name="VCALinkTool"
Name="VCManifestTool" />
/> <Tool
<Tool Name="VCManifestTool"
Name="VCXDCMakeTool" />
/> <Tool
<Tool Name="VCXDCMakeTool"
Name="VCBscMakeTool" />
SuppressStartupBanner="true" <Tool
OutputFile=".\Release/G3DTest.bsc" Name="VCBscMakeTool"
/> SuppressStartupBanner="true"
<Tool OutputFile=".\Release/G3DTest.bsc"
Name="VCFxCopTool" />
/> <Tool
<Tool Name="VCFxCopTool"
Name="VCAppVerifierTool" />
/> <Tool
<Tool Name="VCAppVerifierTool"
Name="VCWebDeploymentTool" />
/> <Tool
<Tool Name="VCWebDeploymentTool"
Name="VCPostBuildEventTool" />
/> <Tool
</Configuration> Name="VCPostBuildEventTool"
<Configuration />
Name="Debug|Win32" </Configuration>
OutputDirectory=".\Debug" <Configuration
IntermediateDirectory=".\Debug" Name="Debug|Win32"
ConfigurationType="1" OutputDirectory=".\Debug"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" IntermediateDirectory=".\Debug"
UseOfMFC="0" ConfigurationType="1"
ATLMinimizesCRunTimeLibraryUsage="false" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
CharacterSet="2" UseOfMFC="0"
> ATLMinimizesCRunTimeLibraryUsage="false"
<Tool CharacterSet="2"
Name="VCPreBuildEventTool" ManagedExtensions="0"
/> >
<Tool <Tool
Name="VCCustomBuildTool" Name="VCPreBuildEventTool"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCCustomBuildTool"
/> />
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCWebServiceProxyGeneratorTool"
PreprocessorDefinitions="_DEBUG" />
MkTypLibCompatible="true" <Tool
SuppressStartupBanner="true" Name="VCMIDLTool"
TargetEnvironment="1" PreprocessorDefinitions="_DEBUG"
TypeLibraryName=".\Debug/G3DTest.tlb" MkTypLibCompatible="true"
HeaderFileName="" SuppressStartupBanner="true"
/> TargetEnvironment="1"
<Tool TypeLibraryName=".\Debug/G3DTest.tlb"
Name="VCCLCompilerTool" HeaderFileName=""
Optimization="0" />
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" <Tool
MinimalRebuild="true" Name="VCCLCompilerTool"
BasicRuntimeChecks="3" Optimization="0"
RuntimeLibrary="2" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
PrecompiledHeaderFile=".\Debug/G3DTest.pch" MinimalRebuild="false"
AssemblerListingLocation=".\Debug/" BasicRuntimeChecks="0"
ObjectFile=".\Debug/" RuntimeLibrary="2"
ProgramDataBaseFileName=".\Debug/" EnableFunctionLevelLinking="true"
WarningLevel="3" PrecompiledHeaderFile=".\Debug/G3DTest.pch"
SuppressStartupBanner="true" AssemblerListingLocation=".\Debug/"
DebugInformationFormat="3" ObjectFile=".\Debug/"
/> ProgramDataBaseFileName=".\Debug/"
<Tool WarningLevel="3"
Name="VCManagedResourceCompilerTool" SuppressStartupBanner="true"
/> DebugInformationFormat="3"
<Tool />
Name="VCResourceCompilerTool" <Tool
PreprocessorDefinitions="_DEBUG" Name="VCManagedResourceCompilerTool"
Culture="4105" />
/> <Tool
<Tool Name="VCResourceCompilerTool"
Name="VCPreLinkEventTool" PreprocessorDefinitions="_DEBUG"
/> Culture="4105"
<Tool />
Name="VCLinkerTool" <Tool
OutputFile=".\Debug/G3DTest.exe" Name="VCPreLinkEventTool"
LinkIncremental="2" />
SuppressStartupBanner="true" <Tool
GenerateDebugInformation="true" Name="VCLinkerTool"
ProgramDatabaseFile=".\Debug/G3DTest.pdb" AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib"
SubSystem="2" OutputFile="./G3DTest-Debug.exe"
TargetMachine="1" LinkIncremental="2"
/> SuppressStartupBanner="true"
<Tool GenerateDebugInformation="true"
Name="VCALinkTool" ProgramDatabaseFile=".\Debug/G3DTest.pdb"
/> SubSystem="2"
<Tool TargetMachine="1"
Name="VCManifestTool" />
/> <Tool
<Tool Name="VCALinkTool"
Name="VCXDCMakeTool" />
/> <Tool
<Tool Name="VCManifestTool"
Name="VCBscMakeTool" />
SuppressStartupBanner="true" <Tool
OutputFile=".\Debug/G3DTest.bsc" Name="VCXDCMakeTool"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCBscMakeTool"
/> SuppressStartupBanner="true"
<Tool OutputFile=".\Debug/G3DTest.bsc"
Name="VCAppVerifierTool" />
/> <Tool
<Tool Name="VCFxCopTool"
Name="VCWebDeploymentTool" />
/> <Tool
<Tool Name="VCAppVerifierTool"
Name="VCPostBuildEventTool" />
/> <Tool
</Configuration> Name="VCWebDeploymentTool"
</Configurations> />
<References> <Tool
<AssemblyReference Name="VCPostBuildEventTool"
RelativePath="System.dll" />
AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" </Configuration>
/> </Configurations>
<AssemblyReference <References>
RelativePath="System.Data.dll" <AssemblyReference
AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" RelativePath="System.dll"
/> AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
<AssemblyReference />
RelativePath="System.Drawing.dll" <AssemblyReference
AssemblyName="System.Drawing, Version=2.0.0.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" RelativePath="System.Data.dll"
/> AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
<AssemblyReference />
RelativePath="System.Windows.Forms.dll" <AssemblyReference
AssemblyName="System.Windows.Forms, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" RelativePath="System.Drawing.dll"
/> AssemblyName="System.Drawing, Version=2.0.0.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
<AssemblyReference />
RelativePath="System.XML.dll" <AssemblyReference
AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" RelativePath="System.Windows.Forms.dll"
/> AssemblyName="System.Windows.Forms, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
</References> />
<Files> <AssemblyReference
<Filter RelativePath="System.XML.dll"
Name="Source Files" AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" />
> </References>
<File <Files>
RelativePath=".\Instance.cpp" <Filter
> Name="Source Files"
</File> Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
<File >
RelativePath="main.cpp" <File
> RelativePath=".\AudioPlayer.cpp"
<FileConfiguration >
Name="Release|Win32" </File>
> <File
<Tool RelativePath=".\ax.cpp"
Name="VCCLCompilerTool" >
PreprocessorDefinitions="" </File>
/> <File
</FileConfiguration> RelativePath=".\BrowserCallHandler.cpp"
<FileConfiguration >
Name="Debug|Win32" </File>
> <File
<Tool RelativePath=".\ButtonListener.cpp"
Name="VCCLCompilerTool" >
PreprocessorDefinitions="" </File>
/> <File
</FileConfiguration> RelativePath=".\CameraController.cpp"
</File> >
<File </File>
RelativePath=".\PhysicalInstance.cpp" <File
> RelativePath=".\Globals.cpp"
</File> >
</Filter> </File>
<Filter <File
Name="Header Files" RelativePath=".\IEBrowser.cpp"
Filter="h;hpp;hxx;hm;inl" >
> </File>
<File <File
RelativePath=".\Instance.h" RelativePath=".\IEBrowser.h"
> >
</File> </File>
<File <File
RelativePath=".\PhysicalInstance.h" RelativePath=".\IEDispatcher.cpp"
> >
</File> </File>
</Filter> <File
<Filter RelativePath="main.cpp"
Name="Resource Files" >
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" <FileConfiguration
> Name="Release|Win32"
</Filter> >
</Files> <Tool
<Globals> Name="VCCLCompilerTool"
</Globals> PreprocessorDefinitions=""
</VisualStudioProject> />
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath=".\propertyGrid.cpp"
>
</File>
<File
RelativePath=".\PropertyWindow.cpp"
>
</File>
<File
RelativePath=".\WindowFunctions.cpp"
>
</File>
<Filter
Name="Instance"
>
<File
RelativePath=".\BaseButtonInstance.cpp"
>
</File>
<File
RelativePath=".\DataModelInstance.cpp"
>
</File>
<File
RelativePath=".\ImageButtonInstance.cpp"
>
</File>
<File
RelativePath=".\Instance.cpp"
>
</File>
<File
RelativePath=".\PhysicalInstance.cpp"
>
</File>
<File
RelativePath=".\TextButtonInstance.cpp"
>
</File>
<File
RelativePath=".\WorkspaceInstance.cpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath=".\ActionType.h"
>
</File>
<File
RelativePath=".\AffectType.h"
>
</File>
<File
RelativePath=".\AudioPlayer.h"
>
</File>
<File
RelativePath=".\ax.h"
>
</File>
<File
RelativePath=".\BinType.h"
>
</File>
<File
RelativePath=".\BrowserCallHandler.h"
>
</File>
<File
RelativePath=".\ButtonListener.h"
>
</File>
<File
RelativePath=".\CameraController.h"
>
</File>
<File
RelativePath=".\ControllerType.h"
>
</File>
<File
RelativePath=".\Demo.h"
>
</File>
<File
RelativePath=".\Globals.h"
>
</File>
<File
RelativePath=".\IEDispatcher.h"
>
</File>
<File
RelativePath=".\InputType.h"
>
</File>
<File
RelativePath=".\JointType.h"
>
</File>
<File
RelativePath=".\KeywordFilterType.h"
>
</File>
<File
RelativePath=".\PartType.h"
>
</File>
<File
RelativePath=".\propertyGrid.h"
>
</File>
<File
RelativePath=".\PropertyWindow.h"
>
</File>
<File
RelativePath=".\resource.h"
>
</File>
<File
RelativePath=".\SoundType.h"
>
</File>
<File
RelativePath=".\Surface.h"
>
</File>
<File
RelativePath=".\SurfaceConstraint.h"
>
</File>
<File
RelativePath=".\SurfaceType.h"
>
</File>
<File
RelativePath=".\win32Defines.h"
>
</File>
<File
RelativePath=".\WindowFunctions.h"
>
</File>
<Filter
Name="Instance"
>
<File
RelativePath=".\BaseButtonInstance.h"
>
</File>
<File
RelativePath=".\DataModelInstance.h"
>
</File>
<File
RelativePath=".\ImageButtonInstance.h"
>
</File>
<File
RelativePath=".\Instance.h"
>
</File>
<File
RelativePath=".\PhysicalInstance.h"
>
</File>
<File
RelativePath=".\TextButtonInstance.h"
>
</File>
<File
RelativePath=".\WorkspaceInstance.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath=".\Dialogs.rc"
>
</File>
<File
RelativePath=".\icon1.ico"
>
</File>
</Filter>
</Files>
<Globals>
<Global
Name="RESOURCE_FILE"
Value="Dialogs.rc"
/>
</Globals>
</VisualStudioProject>

19
Globals.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include "Globals.h"
DataModelInstance* Globals::dataModel = NULL;
int const Globals::gen = 0;
int const Globals::major = 0;
int const Globals::minor = 4;
int const Globals::patch = 2;
int Globals::surfaceId = 2;
bool Globals::showMouse = true;
bool Globals::useMousePoint = false;
const std::string Globals::PlaceholderName = "Dynamica";
G3D::TextureRef Globals::surface;
POINT Globals::mousepoint;
Globals::Globals(void){}
Globals::~Globals(void){}

21
Globals.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include "DataModelInstance.h"
#include <G3DAll.h>
class Globals
{
public:
Globals(void);
~Globals(void);
static DataModelInstance* dataModel;
static bool showMouse;
static POINT mousepoint;
static bool useMousePoint;
static const int gen;
static const int major;
static const int minor;
static const int patch;
static G3D::TextureRef surface;
static int surfaceId;
static const std::string PlaceholderName;
};

68
IEBrowser.cpp Normal file
View File

@@ -0,0 +1,68 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include "IEBrowser.h"
#include "Globals.h"
#include "ax.h"
void IEBrowser::Boop(char* test)
{
}
IEBrowser::IEBrowser(HWND attachHWnd) {
MSG messages;
while (PeekMessage (&messages, NULL, 0, 0,PM_REMOVE))
{
if (IsDialogMessage(hwnd, &messages) == 0)
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
}
hwnd = attachHWnd;
spDocument = 0;
webBrowser = 0;
SendMessage(hwnd,AX_INPLACE,1,0);
SendMessage(hwnd,AX_QUERYINTERFACE,(WPARAM)&IID_IWebBrowser2,(LPARAM)&webBrowser);
}
IEBrowser::~IEBrowser(void) {
if (webBrowser)
{
webBrowser->Release();
}
}
bool IEBrowser::navigateSyncURL(wchar_t* url)
{
MSG messages;
if (webBrowser)
{
webBrowser->Navigate(url,0,0,0,0);
for (int i=1;i<1000;i++)
{
while (PeekMessage (&messages, NULL, 0, 0,PM_REMOVE))
{
if (IsDialogMessage(hwnd, &messages) == 0)
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
}
Sleep(30);
HRESULT hresult = webBrowser->get_Document(&spDocument);
if (&spDocument!=0)
{
return true;
}
}
}
else
{
MessageBox(NULL,"Cannot read IWebBrowser2...",(Globals::PlaceholderName+" Crash").c_str(),MB_OK);
}
return false;
}

16
IEBrowser.h Normal file
View File

@@ -0,0 +1,16 @@
//#include "WindowFunctions.h"
#include <mshtml.h>
#include <exdisp.h>
//#include <Mshtmhst.h>
class IEBrowser {
public:
IEBrowser(HWND attachHWnd);
~IEBrowser(void);
bool navigateSyncURL(wchar_t* url);
void Boop(char* test);
private:
IWebBrowser2* webBrowser;
HWND hwnd;
IDispatch* spDocument;
};

40
IEDispatcher.cpp Normal file
View File

@@ -0,0 +1,40 @@
#include "IEDispatcher.h"
IEDispatcher::IEDispatcher(void)
{
}
IEDispatcher::~IEDispatcher(void)
{
}
HRESULT STDMETHODCALLTYPE IEDispatcher::QueryInterface(const IID &riid, void **ppvObject)
{
return NULL;
}
ULONG STDMETHODCALLTYPE IEDispatcher::AddRef()
{
return NULL;
}
ULONG STDMETHODCALLTYPE IEDispatcher::Release()
{
return NULL;
}
HRESULT STDMETHODCALLTYPE IEDispatcher::GetTypeInfoCount(UINT *pctinfo)
{
return NULL;
}
HRESULT STDMETHODCALLTYPE IEDispatcher::GetTypeInfo(UINT, LCID, ITypeInfo **)
{
return NULL;
}
HRESULT STDMETHODCALLTYPE IEDispatcher::GetIDsOfNames(const IID &, LPOLESTR *, UINT, LCID, DISPID *)
{
return NULL;
}
HRESULT STDMETHODCALLTYPE IEDispatcher::Invoke(DISPID, const IID &, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *)
{
return NULL;
}

17
IEDispatcher.h Normal file
View File

@@ -0,0 +1,17 @@
#pragma once
#include "oaidl.h"
class IEDispatcher : public IDispatch
{
public:
IEDispatcher(void);
~IEDispatcher(void);
HRESULT STDMETHODCALLTYPE IEDispatcher::QueryInterface(const IID &riid, void **ppvObject);
ULONG STDMETHODCALLTYPE IEDispatcher::AddRef();
ULONG STDMETHODCALLTYPE IEDispatcher::Release();
HRESULT STDMETHODCALLTYPE IEDispatcher::GetTypeInfoCount(UINT *pctinfo);
HRESULT STDMETHODCALLTYPE IEDispatcher::GetTypeInfo(UINT, LCID, ITypeInfo **);
HRESULT STDMETHODCALLTYPE IEDispatcher::GetIDsOfNames(const IID &, LPOLESTR *, UINT, LCID, DISPID *);
HRESULT STDMETHODCALLTYPE IEDispatcher::Invoke(DISPID, const IID &, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
};

142
ImageButtonInstance.cpp Normal file
View File

@@ -0,0 +1,142 @@
#include "ImageButtonInstance.h"
G3D::TextureRef image = NULL;
int openGLID = 0;
G3D::TextureRef image_ovr = NULL;
int openGLID_ovr = 0;
G3D::TextureRef image_dn = NULL;
int openGLID_dn = 0;
G3D::TextureRef image_ds = NULL;
int openGLID_ds = 0;
Vector2 size;
Vector2 position;
ImageButtonInstance::ImageButtonInstance(G3D::TextureRef newImage, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL)
{
image = newImage;
openGLID = image->getOpenGLID();
image_ovr = overImage;
if(!image_ovr.isNull())
openGLID_ovr = image_ovr->getOpenGLID();
image_dn = downImage;
if(!image_dn.isNull())
openGLID_dn = image_dn->getOpenGLID();
image_ds = disableImage;
if(!image_ds.isNull())
openGLID_ds = image_ds->getOpenGLID();
Vector2 size = Vector2(0,0);
Vector2 position = Vector2(0,0);
floatCenter = false;
floatBottom = false;
floatRight = false;
disabled = false;
className = "ImageButton";
}
ImageButtonInstance::~ImageButtonInstance(void)
{
//Delete everything on destruction
image.~ReferenceCountedPointer();
delete image.getPointer();
image_ovr.~ReferenceCountedPointer();
delete image_ovr.getPointer();
image_ds.~ReferenceCountedPointer();
delete image_ds.getPointer();
image_dn.~ReferenceCountedPointer();
delete image_dn.getPointer();
image = NULL;
image_ovr = NULL;
image_ds = NULL;
image_dn = NULL;
delete listener;
listener = NULL;
selected = false;
}
bool ImageButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
{
Vector2 positionRelative = position;
if(floatRight && floatBottom)
{
positionRelative = Vector2(rd->getWidth() + position.x, rd->getHeight() + position.y);
}
else if(floatBottom)
{
positionRelative = Vector2(position.x, rd->getHeight() + position.y);
}
else if(floatRight)
{
positionRelative = Vector2(rd->getWidth() + position.x, position.y);
}
if(mousex >= positionRelative.x && mousey >= positionRelative.y)
{
if(mousex < positionRelative.x + size.x && mousey < positionRelative.y + size.y)
{
return true;
}
}
return false;
}
void ImageButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown)
{
bool drawDisabledBox = false;
Vector2 positionRelative = position;
if(floatRight && floatBottom)
{
positionRelative = Vector2(rd->getWidth() + position.x, rd->getHeight() + position.y);
}
else if(floatBottom)
{
positionRelative = Vector2(position.x, rd->getHeight() + position.y);
}
else if(floatRight)
{
positionRelative = Vector2(rd->getWidth() + position.x, position.y);
}
int renderimage = openGLID;
if(selected == true && !image_dn.isNull())
{
renderimage = openGLID_dn;
}
else if(disabled)
{
if(!image_ds.isNull())
renderimage = openGLID_ds;
else
drawDisabledBox = true;
}
else if(mouseInArea(positionRelative.x, positionRelative.y, positionRelative.x + size.x, positionRelative.y + size.y, mousePos.x, mousePos.y))
{
if(mouseDown && !image_dn.isNull())
{
renderimage = openGLID_dn;
}
else if(!image_ovr.isNull())
{
renderimage = openGLID_ovr;
}
}
glEnable( GL_TEXTURE_2D );
glEnable(GL_BLEND);// you enable blending function
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBindTexture( GL_TEXTURE_2D, renderimage);
glBegin( GL_QUADS );
glTexCoord2d(0.0,0.0);
glVertex2f( positionRelative.x, positionRelative.y );
glTexCoord2d( 1.0,0.0 );
glVertex2f( positionRelative.x + size.x, positionRelative.y );
glTexCoord2d( 1.0,1.0 );
glVertex2f( positionRelative.x + size.x, positionRelative.y + size.y );
glTexCoord2d( 0.0,1.0 );
glVertex2f( positionRelative.x, positionRelative.y + size.y );
glEnd();
glDisable( GL_TEXTURE_2D );
if(drawDisabledBox)
{
Draw::box(Box(Vector3(positionRelative.x, positionRelative.y, 0), Vector3(positionRelative.x+size.x, positionRelative.y+size.y, 0)), rd, Color4(0.7F,0.7F,0.7F,0.3F), Color4::clear());
}
}

24
ImageButtonInstance.h Normal file
View File

@@ -0,0 +1,24 @@
#pragma once
#include "BaseButtonInstance.h"
class ImageButtonInstance : public BaseButtonInstance
{
public:
//ImageButtonInstance(G3D::TextureRef);
//ImageButtonInstance(G3D::TextureRef,G3D::TextureRef);
//ImageButtonInstance(G3D::TextureRef,G3D::TextureRef,G3D::TextureRef);
ImageButtonInstance(G3D::TextureRef,G3D::TextureRef,G3D::TextureRef,G3D::TextureRef);
~ImageButtonInstance(void);
void drawObj(RenderDevice*, Vector2, bool);
Vector2 size;
Vector2 position;
G3D::TextureRef image;
int openGLID;
G3D::TextureRef image_ovr;
int openGLID_ovr;
G3D::TextureRef image_dn;
int openGLID_dn;
G3D::TextureRef image_ds;
int openGLID_ds;
bool mouseInButton(float, float, RenderDevice*);
};

4
InputType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef INPUTTYPE_H
#define INPUTTYPE_H
static enum InputType {NoInput, LeftTread, RightTread, Steer, Throtle, UpDown, Action1, Action2, Action3, Action4, Action5, Constant, Sin};
#endif

View File

@@ -1,21 +1,112 @@
#define WINVER 0x0400
#include <G3DAll.h> #include <G3DAll.h>
#include "Instance.h" #include "Instance.h"
std::string name; std::string name;
Instance* parent; Instance* parent = NULL;
static std::string className = "Instance"; std::vector<Instance* > children;
static std::string className = "BaseInstance";
Instance::Instance(void) Instance::Instance(void)
{ {
parent = NULL;
name = "Default Game Instance"; name = "Default Game Instance";
className = "Part"; className = "BaseInstance";
}
Instance::Instance(const Instance &oinst)
{
setParent(oinst.parent);
name = oinst.name;
className = oinst.className;
}
void Instance::render(RenderDevice* rd)
{
for(size_t i = 0; i < children.size(); i++)
{
children.at(i)->render(rd);
}
} }
Instance::~Instance(void) Instance::~Instance(void)
{ {
name = "Default Game Instance"; for(size_t i = 0; i < children.size(); i++)
{
delete children.at(i);
}
} }
std::string Instance::getClassName()
{
return className;
}
std::vector<Instance* > Instance::getChildren()
{
return children;
}
std::vector<Instance* > Instance::getAllChildren()
{
if(!children.empty())
{
std::vector<Instance* > totalchildren = children;
for(size_t i = 0; i < children.size(); i++)
{
std::vector<Instance* > subchildren = children.at(i)->getAllChildren();
if(!subchildren.empty())
totalchildren.insert(totalchildren.end(), subchildren.begin(), subchildren.end());
}
return totalchildren;
}
return children;
}
void Instance::setParent(Instance* newParent)
{
if(parent != NULL)
{
parent->removeChild(this);
}
parent = newParent;
if(newParent != NULL)
{
newParent->addChild(this);
}
}
Instance* Instance::getParent()
{
return parent;
}
void Instance::addChild(Instance* newChild)
{
children.push_back(newChild);
}
void Instance::removeChild(Instance* oldChild)
{
for(size_t i = 0; i < children.size(); i++)
{
if(children.at(i) == oldChild)
{
children.erase(children.begin() + i);
}
}
}
Instance* Instance::findFirstChild(std::string name)
{
Instance* child = NULL;
for(size_t i = 0; i < children.size(); i++)
{
if(children.at(i)->name == name)
{
child = children.at(i);
break;
}
}
return child;
}

View File

@@ -1,11 +1,25 @@
#include <G3DAll.h>
#pragma once #pragma once
class Instance class Instance
{ {
public: public:
Instance(void); Instance(void);
~Instance(void); Instance(const Instance&);
virtual ~Instance(void);
std::string name; std::string name;
Instance* parent; // Another pointer. virtual void render(RenderDevice*);
std::vector<Instance*> children; // All children.
std::string getClassName();
Instance* findFirstChild(std::string);
std::vector<Instance* > getChildren();
std::vector<Instance* > getAllChildren();
void setParent(Instance*);
void addChild(Instance*);
void removeChild(Instance*);
Instance* getParent();
virtual Instance* clone() const { return new Instance(*this); }
protected:
std::string className; std::string className;
Instance* parent; // Another pointer.
}; };

4
JointType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef JOINTTYPE_H
#define JOINTTYPE_H
static enum ActionType {UNK0, Weld, Snap, UNK3, Rotate, RotateP, RotateV, Glue, UNK8, UNK9, None};
#endif

4
KeywordFilterType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef KEYWORDFILTERTYPE_H
#define KEYWORDFILTERTYPE_H
static enum KeywordFilterType {Include, Exclude};
#endif

4
PartType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef PARTTYPE_H
#define PARTTYPE_H
static enum PartType {Ball, Block, Cylinder};
#endif

View File

@@ -1,25 +1,214 @@
#include <G3DAll.h>
#include "PhysicalInstance.h" #include "PhysicalInstance.h"
#include "Globals.h"
bool canCollide = true; GLfloat vertecies[96];
bool anchored = false; bool changed = true;
Vector3 size; Box itemBox = Box();
Vector3 position;
Vector3 velocity;
Vector3 rotVelocity;
Color3 color;
PhysicalInstance::PhysicalInstance(void) PhysicalInstance::PhysicalInstance(void)
{ {
name = "Default PhysicalInstance"; name = "Default PhysicalInstance";
className = "Part"; className = "Part";
canCollide = true; canCollide = true;
anchored = true; anchored = true;
size = Vector3(2,1,4); size = Vector3(2,1,4);
position = Vector3(0,0,0); setCFrame(CoordinateFrame(Vector3(0,0,0)));
color = Color3::gray(); color = Color3::gray();
velocity = Vector3(0,0,0); velocity = Vector3(0,0,0);
rotVelocity = Vector3(0,0,0); rotVelocity = Vector3(0,0,0);
top = Smooth;
front = Smooth;
right = Smooth;
back = Smooth;
left = Smooth;
bottom = Smooth;
}
PhysicalInstance::PhysicalInstance(const PhysicalInstance &oinst)
{
name = oinst.name;
className = "Part";
canCollide = oinst.canCollide;
setParent(oinst.parent);
anchored = oinst.anchored;
size = oinst.size;
setCFrame(oinst.cFrame);
color = oinst.color;
velocity = oinst.velocity;
rotVelocity = oinst.rotVelocity;
top = oinst.top;
front = oinst.front;
right = oinst.right;
back = oinst.back;
left = oinst.left;
bottom = oinst.bottom;
}
void PhysicalInstance::setSize(Vector3 newSize)
{
int minsize = 1;
int maxsize = 512;
changed = true;
int sizex = (int)newSize.x;
if(sizex <= 0)
sizex = 1;
if(sizex > 512)
sizex = 512;
int sizey = (int)newSize.y;
if(sizey <= 0)
sizey = 1;
if(sizey > 512)
sizey = 512;
int sizez = (int)newSize.z;
if(sizez <= 0)
sizez = 1;
if(sizez > 512)
sizez = 512;
size = Vector3(sizex, sizey, sizez);
}
Vector3 PhysicalInstance::getSize()
{
return size;
}
Vector3 PhysicalInstance::getPosition()
{
return position;
}
void PhysicalInstance::setPosition(Vector3 pos)
{
position = pos;
cFrame = CoordinateFrame(pos);
changed = true;
}
CoordinateFrame PhysicalInstance::getCFrame()
{
return cFrame;
}
void PhysicalInstance::setCFrame(CoordinateFrame coordinateFrame)
{
cFrame = coordinateFrame;
position = coordinateFrame.translation;
changed = true;
}
CoordinateFrame PhysicalInstance::getCFrameRenderBased()
{
return CoordinateFrame(getCFrame().rotation,Vector3(getCFrame().translation.x/2, getCFrame().translation.y/2, getCFrame().translation.z/2));
}
Box PhysicalInstance::getBox()
{
if(changed)
{
Box box = Box(Vector3(0+size.x/4, 0+size.y/4, 0+size.z/4) ,Vector3(0-size.x/4,0-size.y/4,0-size.z/4));
CoordinateFrame c = getCFrameRenderBased();
itemBox = c.toWorldSpace(box);
Vector3 v0,v1,v2,v3;
for (int f = 0; f < 6; f++) {
itemBox.getFaceCorners(f, v0,v1,v2,v3);
vertecies[f*16] = v0.x;
vertecies[(f*16)+1] = v0.y;
vertecies[(f*16)+2] = v0.z;
vertecies[(f*16)+3] = v1.x;
vertecies[(f*16)+4] = v1.y;
vertecies[(f*16)+5] = v1.z;
vertecies[(f*16)+6] = v2.x;
vertecies[(f*16)+7] = v2.y;
vertecies[(f*16)+8] = v2.z;
vertecies[(f*16)+9] = v3.x;
vertecies[(f*16)+10] = v3.y;
vertecies[(f*16)+11] = v3.z;
vertecies[(f*16)+12] = color.r;
vertecies[(f*16)+13] = color.g;
vertecies[(f*16)+14] = color.b;
vertecies[(f*16)+15] = 1;
}
}
return itemBox;
}
bool PhysicalInstance::collides(Box box)
{
return CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(getBox(), box);
}
void PhysicalInstance::render(RenderDevice* rd)
{
if(changed)
Box box = getBox();
glColor(color);
/*glEnable( GL_TEXTURE_2D );
glEnable(GL_BLEND);// you enable blending function
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBindTexture( GL_TEXTURE_2D, Globals::surfaceId);
glBegin(GL_QUADS);*/
for(int i = 0; i < 96; i+=16)
{
double add = 0.8;
Surface face;
if(i == 0)//Back
face = back;
else if(i == 16)//Right
face = right;
else if(i == 32)//Front
face = front;
else if(i == 48)//Top
face = top;
else if(i == 64)//Left
face = left;
else if(i == 80)//Bottom
face = bottom;
/*if(face == Snaps)
add = 0.0;
else if(face == Inlets)
add = 0.2;*/
Vector3 v0 = Vector3(vertecies[i], vertecies[i+1], vertecies[i+2]), v1 = Vector3(vertecies[i+3], vertecies[i+4], vertecies[i+5]), v3 = Vector3(vertecies[i+9], vertecies[i+10], vertecies[i+11]);
/*glNormal3fv((v1 - v0).cross(v3 - v0).direction());
glTexCoord2f(0.0F,0.0F);
glVertex3fv(v0);
glTexCoord2f(1.0F,0.0F);
glVertex3fv(v1);
glTexCoord2f(1.0F,0.25F);
glVertex3f(vertecies[i+6], vertecies[i+7], vertecies[i+8]);
glTexCoord2f(0.0F,0.25F);
glVertex3fv(v3);*/
glEnable( GL_TEXTURE_2D );
glEnable(GL_BLEND);// you enable blending function
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBindTexture( GL_TEXTURE_2D, Globals::surfaceId);
glBegin( GL_QUADS );
glNormal3fv((v1 - v0).cross(v3 - v0).direction());
glTexCoord2d(0.0,0.0+add);
glVertex3fv(v0);
glTexCoord2d( 1.0,0.0+add);
glVertex3fv(v1);
glTexCoord2d(1.0,0.2+add);
glVertex3f(vertecies[i+6], vertecies[i+7], vertecies[i+8]);
glTexCoord2d( 0.0,0.2+add);
glVertex3fv(v3);
glEnd();
glDisable( GL_TEXTURE_2D );
}
/*glEnd();
glDisable(GL_TEXTURE_2D);*/
glColor(Color3::white());
if(!children.empty())
{
for(size_t i = 0; i < children.size(); i++)
{
children.at(i)->render(rd);
}
}
} }
PhysicalInstance::~PhysicalInstance(void) PhysicalInstance::~PhysicalInstance(void)
@@ -27,3 +216,5 @@ PhysicalInstance::~PhysicalInstance(void)
} }

View File

@@ -1,15 +1,39 @@
#pragma once #pragma once
#include "instance.h" #include "instance.h"
#include "Surface.h"
class PhysicalInstance : class PhysicalInstance :
public Instance public Instance
{ {
public: public:
PhysicalInstance(void); PhysicalInstance(void);
PhysicalInstance(const PhysicalInstance &oinst);
Instance* clone() const { return new PhysicalInstance(*this); }
~PhysicalInstance(void); ~PhysicalInstance(void);
Vector3 size; virtual void render(RenderDevice*);
Vector3 position;
Vector3 velocity; Vector3 velocity;
Vector3 rotvelocity; Surface top;
Surface front;
Surface right;
Surface back;
Surface left;
Surface bottom;
CoordinateFrame cFrame;
Color3 color; Color3 color;
Vector3 getPosition();
void setPosition(Vector3);
CoordinateFrame getCFrame();
void setCFrame(CoordinateFrame);
Box getBox();
Box getScaledBox();
CoordinateFrame getCFrameRenderBased();
Vector3 getSize();
void setSize(Vector3);
bool canCollide;
bool anchored;
Vector3 rotVelocity;
bool collides(Box);
private:
Vector3 position;
Vector3 size;
}; };

109
PropertyWindow.cpp Normal file
View File

@@ -0,0 +1,109 @@
#include <windows.h>
#include "WindowFunctions.h"
#include "propertyGrid.h"
#include "resource.h"
#include "PropertyWindow.h"
LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PropertyWindow *propWind = (PropertyWindow *)GetWindowLongPtr(hwnd, GWL_USERDATA);
if (propWind==NULL)
{
return DefWindowProc(hwnd, msg, wParam, lParam);
}
switch(msg)
{
case WM_SIZE:
{
propWind->onResize();
}
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance) {
if (!createWindowClass("propHWND",PropProc,hThisInstance))
return false;
_hwndProp = CreateWindowEx(
WS_EX_TOOLWINDOW,
"propHWND",
"Prop Test",
WS_VISIBLE | WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION,
CW_USEDEFAULT,
CW_USEDEFAULT,
300,
660,
NULL, // parent
NULL, // menu
hThisInstance,
NULL
);
_propGrid = New_PropertyGrid(_hwndProp,IDC_PROPERTYGRID);
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog="Test";
pItem.lpszPropName="Offset";
pItem.lpszzCmbItems="What";
pItem.lpszPropDesc="Description";
pItem.lpCurValue=(LPARAM)"0, 0, 0";
pItem.iItemType=PIT_EDIT;
PROPGRIDITEM pItem2;
PropGrid_ItemInit(pItem2);
pItem2.lpszCatalog="Test";
pItem2.lpszPropName="s";
pItem2.lpszzCmbItems="itemlist\0itemlist2\0itemlist3";
pItem2.lpszPropDesc="";
pItem2.lpCurValue=0;
pItem2.iItemType=PIT_COMBO;
/*PROPGRIDITEM FauxExplorerItem;
PropGrid_ItemInit(FauxExplorerItem);
FauxExplorerItem.lpszCatalog="Test";
FauxExplorerItem.lpszPropName = "Editable Combo Field";
FauxExplorerItem.lpszzCmbItems = "Test1\0Test2\0Test3";
FauxExplorerItem.lpszPropDesc = "Press F4 to view drop down.";
FauxExplorerItem.iItemType = PIT_EDITCOMBO;
FauxExplorerItem.lpCurValue = 1;
PropGrid_AddItem(_propGrid, &FauxExplorerItem);*/
PropGrid_Enable(_propGrid,true);
ShowWindow(_propGrid,SW_SHOW);
PropGrid_AddItem(_propGrid,&pItem);
PropGrid_AddItem(_propGrid,&pItem2);
PropGrid_SetItemHeight(_propGrid,20);
PropGrid_ShowToolTips(_propGrid,TRUE);
PropGrid_ShowPropertyDescriptions(_propGrid,TRUE);
PropGrid_ExpandAllCatalogs(_propGrid);
SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this);
_redraw();
return true;
}
PropertyWindow::PropertyWindow(int x, int y, int sx, int sy, HMODULE hThisInstance) {
onCreate(x, y, sx, sy, hThisInstance);
}
void PropertyWindow::onResize()
{
_redraw();
}
void PropertyWindow::_redraw()
{
RECT rect;
GetClientRect(_hwndProp,&rect);
SetWindowPos(_propGrid, NULL, 0, 20, rect.right, rect.bottom-20, SWP_NOZORDER | SWP_NOACTIVATE);
}

12
PropertyWindow.h Normal file
View File

@@ -0,0 +1,12 @@
#pragma once
class PropertyWindow {
public:
PropertyWindow(int x, int y, int sx, int sy, HMODULE hThisInstance);
bool onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance);
void onResize();
private:
HWND _propGrid;
HWND _hwndProp;
void _redraw();
};

10
README.md Normal file
View File

@@ -0,0 +1,10 @@
# ROBLOX 2005 Recreation Project
## Why are we doing this?
ROBLOX in 2005 was a different game, based around minigames with win and lose conditions rather than a 3D building game. Since this build of the client is presumed lost despite having around 100 users, we have to recreate it. We are using era-appropriate tools for this as well (Visual Studio 2005 and 2005-era compilers), as well as G3D 6.10, the era-appropriate version of the Graphics3D graphics library used by ROBLOX to this day.
## Features
Equivalent to known features of 05 as it stood in October 2005 with the 'Morgan McGuire builds'
## Credits
- Morgan McGuire, creator of G3D - his old pre-2006 website for the only existing colour pictures of 2005 era roblox on the internet, as well as a couple of helpful emails. He assisted roblox development in the 2004-2006 timeframe.
- David Baszucki and Erik Cassel (1967-2013, RIP) - for creating roblox

BIN
SDL.dll

Binary file not shown.

4
SoundType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef SOUNDTYPE_H
#define SOUNDTYPE_H
static enum SoundType {NoSound, Boing, Bomb, Break, Click, Clock, Slingshot, Page, Ping, Snap, Splat, Step, StepOn, Swoosh, Victory};
#endif

4
Surface.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef SURFACE_H
#define SURFACE_H
static enum Surface {Smooth, Snaps, Inlets, Glue, Weld, Hinge, Motor};
#endif

4
SurfaceConstraint.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef SURFACECONSTRAINT_H
#define SURFACECONSTRAINT_H
static enum SurfaceConstraint {None, Hinge, SteppingMotor, Motor};
#endif

4
SurfaceType.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef SURFACETYPE_H
#define SURFACETYPE_H
static enum SurfaceType {Smooth, Bumps, Weld, Snaps, Inlet};
#endif

121
TextButtonInstance.cpp Normal file
View File

@@ -0,0 +1,121 @@
#include "TextButtonInstance.h"
Vector2 boxBegin;
Vector2 boxEnd;
Vector2 fontLocationRelativeTo;
Color4 textColor;
Color4 textOutlineColor;
Color4 boxColor;
Color4 boxOutlineColor;
Color4 textColorOvr;
Color4 textOutlineColorOvr;
Color4 boxColorOvr;
Color4 boxOutlineColorOvr;
Color4 textColorDn;
Color4 textOutlineColorDn;
Color4 boxColorDn;
Color4 boxOutlineColorDn;
bool centeredWithinBox;
std::string title;
G3D::GFontRef* font;
int textSize;
bool visible;
TextButtonInstance::TextButtonInstance(void)
{
boxBegin = Vector2(0,0);
boxEnd = Vector2(0,0);
fontLocationRelativeTo = Vector2(0,0);
centeredWithinBox = false;
title = "TextBox";
textColor = Color4(1, 1, 1, 1);
textOutlineColor = Color4(0, 0, 0, 0);
boxColor = Color4(0.6F,0.6F,0.6F,0.4F);
boxOutlineColor = Color4(0, 0, 0, 0);
setAllColorsSame();
textSize = 12;
floatBottom = false;
floatRight = false;
floatCenter = false;
visible = true;
className = "TextButton";
disabled = false;
}
bool TextButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
{
Vector3 point1;
Vector3 point2;
if(floatBottom)
{
point1 = Vector3(boxBegin.x, rd->getHeight() + boxBegin.y,0);
point2 = Vector3(boxEnd.x, rd->getHeight() + boxEnd.y,0);
}
else
{
point1 = Vector3(boxBegin.x, boxBegin.y,0);
point2 = Vector3(boxEnd.x, boxEnd.y,0);
}
if(mousex >= point1.x && mousey >= point1.y)
{
if(mousex < point2.x && mousey < point2.y)
{
return true;
}
}
return false;
}
void TextButtonInstance::setAllColorsSame()
{
textColorOvr = textColor;
textOutlineColorOvr = textOutlineColor;
boxColorOvr = boxColor;
boxOutlineColorOvr = boxOutlineColor;
textColorDn = textColor;
textOutlineColorDn = textOutlineColor;
boxColorDn = boxColor;
boxOutlineColorDn = boxOutlineColor;
}
TextButtonInstance::~TextButtonInstance(void)
{
}
void TextButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown)
{
Vector3 point1;
Vector3 point2;
if(floatBottom)
{
point1 = Vector3(boxBegin.x, rd->getHeight() + boxBegin.y,0);
point2 = Vector3(boxEnd.x, rd->getHeight() + boxEnd.y,0);
}
else
{
point1 = Vector3(boxBegin.x, boxBegin.y,0);
point2 = Vector3(boxEnd.x, boxEnd.y,0);
}
Vector2 RelativeTo = Vector2(point1.x + fontLocationRelativeTo.x, point1.y + fontLocationRelativeTo.y);
if(mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y) && mouseDown)
{
Draw::box(Box(point1, point2), rd, boxColorDn, boxOutlineColorDn);
font->draw2D(rd, title, RelativeTo, textSize, textColorDn, textOutlineColorDn);
}
else if(mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y))
{
Draw::box(Box(point1, point2), rd, boxColorOvr, boxOutlineColorOvr);
font->draw2D(rd, title, RelativeTo, textSize, textColorOvr, textOutlineColorOvr);
}
else
{
Draw::box(Box(point1, point2), rd, boxColor, boxOutlineColor);
font->draw2D(rd, title, RelativeTo, textSize, textColor, textOutlineColor);
}
}
void doNullCheck()
{
}

31
TextButtonInstance.h Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
#include "BaseButtonInstance.h"
class TextButtonInstance : public BaseButtonInstance
{
public:
TextButtonInstance(void);
~TextButtonInstance(void);
void setAllColorsSame();
Vector2 boxBegin;
Vector2 boxEnd;
Vector2 fontLocationRelativeTo;
Color4 textColor;
Color4 textOutlineColor;
Color4 boxColor;
Color4 boxOutlineColor;
Color4 textColorOvr;
Color4 textOutlineColorOvr;
Color4 boxColorOvr;
Color4 boxOutlineColorOvr;
Color4 textColorDn;
Color4 textOutlineColorDn;
Color4 boxColorDn;
Color4 boxOutlineColorDn;
bool centeredWithinBox;
std::string title;
G3D::GFontRef font;
bool visible;
int textSize;
void drawObj(RenderDevice*, Vector2, bool);
bool mouseInButton(float, float, RenderDevice*);
};

32
WindowFunctions.cpp Normal file
View File

@@ -0,0 +1,32 @@
#include "WindowFunctions.h"
#include <sstream>
#include <string>
using namespace std;
bool createWindowClass(const char* name,WNDPROC proc,HMODULE hInstance)
{
WNDCLASSEX wc;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = proc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = name;
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if (!RegisterClassEx (&wc))
{
stringstream errMsg;
errMsg<<"Failed to register " << name;
MessageBox(NULL, errMsg.str().c_str(),"Dynamica Crash", MB_OK);
return false;
}
return true;
}

4
WindowFunctions.h Normal file
View File

@@ -0,0 +1,4 @@
#pragma once
#include <windows.h>
bool createWindowClass(const char* name,WNDPROC proc,HMODULE hInstance);

14
WorkspaceInstance.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include "WorkspaceInstance.h"
float timer = 60.0F;
int score = 0;
WorkspaceInstance::WorkspaceInstance(void)
{
className = "Workspace";
timer = 60.0F;
score = 0;
}
WorkspaceInstance::~WorkspaceInstance(void)
{
}

12
WorkspaceInstance.h Normal file
View File

@@ -0,0 +1,12 @@
#pragma once
#include "instance.h"
class WorkspaceInstance :
public Instance
{
public:
float timer;
int score;
WorkspaceInstance(void);
~WorkspaceInstance(void);
};

639
ax.cpp Normal file
View File

@@ -0,0 +1,639 @@
// AX.CPP
#include <windows.h>
#include <comdef.h>
#include <exdisp.h>
#include <oledlg.h>
#include "ax.h"
#pragma warning (disable: 4311)
#pragma warning (disable: 4312)
#pragma warning (disable: 4244)
#pragma warning (disable: 4800)
// AXClientSite class
// ------- Implement member functions
AXClientSite :: AXClientSite()
{
refNum = 0;
CalledCanInPlace = 0;
InPlace = 0;
}
AXClientSite :: ~AXClientSite()
{
}
// IUnknown methods
STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject)
{
*ppvObject = 0;
if (iid == IID_IOleClientSite)
*ppvObject = (IOleClientSite*)this;
if (iid == IID_IUnknown)
*ppvObject = this;
if (iid == IID_IAdviseSink)
*ppvObject = (IAdviseSink*)this;
if (iid == IID_IDispatch)
*ppvObject = (IDispatch*)this;
if (ExternalPlace == false)
{
if (iid == IID_IOleInPlaceSite)
*ppvObject = (IOleInPlaceSite*)this;
if (iid == IID_IOleInPlaceFrame)
*ppvObject = (IOleInPlaceFrame*)this;
if (iid == IID_IOleInPlaceUIWindow)
*ppvObject = (IOleInPlaceUIWindow*)this;
}
//* Log Call
if (*ppvObject)
{
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) AXClientSite :: AddRef()
{
refNum++;
return refNum;
}
STDMETHODIMP_(ULONG) AXClientSite :: Release()
{
refNum--;
return refNum;
}
// IOleClientSite methods
STDMETHODIMP AXClientSite :: SaveObject()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: GetMoniker(DWORD dwA,DWORD dwW,IMoniker**pm)
{
*pm = 0;
return E_NOTIMPL;
}
STDMETHODIMP AXClientSite :: GetContainer(IOleContainer**pc)
{
*pc = 0;
return E_FAIL;
}
STDMETHODIMP AXClientSite :: ShowObject()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: OnShowWindow(BOOL f)
{
InvalidateRect(Window, 0, TRUE);
InvalidateRect(Parent, 0, TRUE);
return S_OK;
}
STDMETHODIMP AXClientSite :: RequestNewObjectLayout()
{
return S_OK;
}
STDMETHODIMP_(void) AXClientSite :: OnViewChange(DWORD dwAspect,LONG lIndex)
{
}
STDMETHODIMP_(void) AXClientSite :: OnRename(IMoniker * pmk)
{
}
STDMETHODIMP_(void) AXClientSite :: OnSave()
{
}
STDMETHODIMP_(void) AXClientSite :: OnClose()
{
}
// IOleInPlaceSite methods
STDMETHODIMP AXClientSite :: GetWindow(HWND *p)
{
*p = Window;
return S_OK;
}
STDMETHODIMP AXClientSite :: ContextSensitiveHelp(BOOL)
{
return E_NOTIMPL;
}
STDMETHODIMP AXClientSite :: CanInPlaceActivate()
{
if (InPlace)
{
CalledCanInPlace = true;
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP AXClientSite :: OnInPlaceActivate()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: OnUIActivate()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: GetWindowContext(IOleInPlaceFrame** ppFrame,IOleInPlaceUIWindow **ppDoc,LPRECT r1,LPRECT r2,LPOLEINPLACEFRAMEINFO o)
{
*ppFrame = (IOleInPlaceFrame*)this;
AddRef();
*ppDoc = NULL;
GetClientRect(Window,r1);
GetClientRect(Window,r2);
o->cb = sizeof(OLEINPLACEFRAMEINFO);
o->fMDIApp = false;
o->hwndFrame = Parent;
o->haccel = 0;
o->cAccelEntries = 0;
return S_OK;
}
STDMETHODIMP AXClientSite :: Scroll(SIZE s)
{
return E_NOTIMPL;
}
STDMETHODIMP AXClientSite :: OnUIDeactivate(int)
{
return S_OK;
}
STDMETHODIMP AXClientSite :: OnInPlaceDeactivate()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: DiscardUndoState()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: DeactivateAndUndo()
{
return S_OK;
}
STDMETHODIMP AXClientSite :: OnPosRectChange(LPCRECT)
{
return S_OK;
}
// IOleInPlaceFrame methods
STDMETHODIMP AXClientSite :: GetBorder(LPRECT l)
{
GetClientRect(Window,l);
return S_OK;
}
STDMETHODIMP AXClientSite :: RequestBorderSpace(LPCBORDERWIDTHS b)
{
//return S_OK;
return E_NOTIMPL;
}
STDMETHODIMP AXClientSite :: SetBorderSpace(LPCBORDERWIDTHS b)
{
return S_OK;
}
STDMETHODIMP AXClientSite :: SetActiveObject(IOleInPlaceActiveObject*pV,LPCOLESTR s)
{
ax->Pao = pV;
return S_OK;
}
STDMETHODIMP AXClientSite :: SetStatusText(LPCOLESTR t)
{
return E_NOTIMPL;
}
STDMETHODIMP AXClientSite :: EnableModeless(BOOL f)
{
return E_NOTIMPL;
}
STDMETHODIMP AXClientSite :: TranslateAccelerator(LPMSG,WORD)
{
return E_NOTIMPL;
}
// IDispatch Methods
HRESULT _stdcall AXClientSite :: GetTypeInfoCount(
unsigned int * pctinfo) {return E_NOTIMPL;}
HRESULT _stdcall AXClientSite :: GetTypeInfo(
unsigned int iTInfo,
LCID lcid,
ITypeInfo FAR* FAR* ppTInfo) {return E_NOTIMPL;}
HRESULT _stdcall AXClientSite :: GetIDsOfNames(
REFIID riid,
OLECHAR FAR* FAR*,
unsigned int cNames,
LCID lcid,
DISPID FAR* ) {return E_NOTIMPL;}
// Other Methods
void AX :: Init(char* cls)
{
wchar_t x[1000] = {0};
MultiByteToWideChar(CP_ACP,0,cls,-1,x,1000);
CLSIDFromString(x,&clsid);
iid = (IID*)&IID_IOleObject;
OleObject = 0;
Storage = 0;
View = 0;
Data = 0;
Unk = 0;
Pao = 0;
AdviseToken = 0;
memset(DAdviseToken,0,sizeof(DAdviseToken));
Site.ax = this;
}
AX :: AX(char* cls)
{
Init(cls);
}
void AX :: Clean()
{
if (Site.InPlace == true)
{
Site.InPlace = false;
IOleInPlaceObject* iib = 0;
if (OleObject)
OleObject->QueryInterface(IID_IOleInPlaceObject,(void**)&iib);
if (iib)
{
iib->UIDeactivate();
iib->InPlaceDeactivate();
iib->Release();
}
}
if (AdviseToken && OleObject)
{
OleObject->Unadvise(AdviseToken);
AdviseToken = 0;
}
if (Data)
{
for(int i = 0 ; i < 100 ; i++)
if (DAdviseToken[i])
Data->DUnadvise(DAdviseToken[i]);
memset(DAdviseToken,0,sizeof(DAdviseToken));
}
if (Pao) Pao->Release();
if (Unk) Unk->Release();
if (Data) Data->Release();
if (View) View->Release();
if (Storage) Storage->Release();
if (OleObject) OleObject->Release();
Unk = 0;
Data = 0;
View = 0;
Storage = 0;
OleObject = 0;
}
AX :: ~AX()
{
Clean();
}
CLSID AX :: GetCLSID()
{
return clsid;
}
HRESULT _stdcall AXClientSite :: InsertMenus(HMENU h,LPOLEMENUGROUPWIDTHS x)
{
/* AX * t = (AX*)ax;
if (t->AddMenu)
{
x->width[0] = 0;
x->width[2] = 0;
x->width[4] = 0;
//InsertMenu(h,0,MF_BYPOSITION | MF_POPUP,(int)Menu,"test");
return S_OK;
}
*/
return E_NOTIMPL;
}
HRESULT _stdcall AXClientSite :: SetMenu(HMENU h,HOLEMENU hO,HWND hw)
{
AX * t = (AX*)ax;
/* if (t->AddMenu)
{
if (!h && !hO)
{
//::SetMenu(Window,Menu);
//DrawMenuBar(Window);
::SetMenu(Parent,Menu);
DrawMenuBar(Parent);
return S_OK;
}
//::SetMenu(Window,h);
//DrawMenuBar(Window);
//HMENU hm = GetMenu(Parent);
//AppendMenu(hm,MF_POPUP | MF_MENUBREAK,(int)h,0);
//::SetMenu(Parent,hm);
::SetMenu(Parent,h);
DrawMenuBar(Parent);
//hOleWindow = hw;
//OleSetMenuDescriptor(hO,Window,hw,0,0);
OleSetMenuDescriptor(hO,Parent,hw,0,0);
return S_OK;
}
*/
return E_NOTIMPL;
}
HRESULT _stdcall AXClientSite :: RemoveMenus(HMENU h)
{
AX * t = (AX*)ax;
if (t->AddMenu)
{
if (!h)
return S_OK;
int c = GetMenuItemCount(h);
for (int i = c ; i >= 0 ; i--)
{
HMENU hh = GetSubMenu(h,i);
if (hh == Menu)
RemoveMenu(h,i,MF_BYPOSITION);
}
if (h == Menu)
DestroyMenu(h);
//DrawMenuBar(Window);
DrawMenuBar(Parent);
return S_OK;
}
return E_NOTIMPL;
}
HRESULT _stdcall AXClientSite :: Invoke(
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS FAR* pDispParams,
VARIANT FAR* pVarResult,
EXCEPINFO FAR* pExcepInfo,
unsigned int FAR* puArgErr)
{
return E_NOTIMPL;
}
void _stdcall AXClientSite :: OnDataChange(FORMATETC *pFormatEtc,STGMEDIUM *pStgmed)
{
// Notify our app that a change is being requested
return;
}
// Window Procedure for AX control
LRESULT CALLBACK AXWndProc(HWND hh,UINT mm,WPARAM ww,LPARAM ll)
{
if (mm == WM_CREATE)
{
char tit[1000] = {0};
HRESULT hr;
GetWindowTextA(hh,tit,1000);
AX* ax;
ax = new AX(tit);
SetWindowLong(hh,GWL_USERDATA,(LONG)ax);
ax->Site.Window = hh;
ax->Site.Parent = GetParent(hh);
hr = StgCreateDocfile(0,STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DIRECT | STGM_CREATE,0,&ax->Storage);
ax->Site.Window = hh;
REFIID rid = *ax->iid;
hr = OleCreate(ax->GetCLSID(),rid,OLERENDER_DRAW,0,&ax->Site,ax->Storage,(void**)&ax->OleObject);
if (!ax->OleObject)
{
delete ax;
SetWindowLong(hh,GWL_USERDATA,0);
return -1;
}
hr = OleSetContainedObject(ax->OleObject, TRUE);
hr = ax->OleObject->Advise(&ax->Site,&ax->AdviseToken);
hr = ax->OleObject->QueryInterface(IID_IViewObject,(void**)&ax->View);
hr = ax->OleObject->QueryInterface(IID_IDataObject,(void**)&ax->Data);
if (ax->View)
hr = ax->View->SetAdvise(DVASPECT_CONTENT,0,&ax->Site);
return 0;
}
if (mm == WM_DESTROY)
{
AX* ax = (AX*)GetWindowLong(hh,GWL_USERDATA);
if (!ax)
return 0;
ax->Clean();
return true;
}
if (mm == AX_SETDATAADVISE)
{
AX* ax = (AX*)GetWindowLong(hh,GWL_USERDATA);
if (!ax)
return 0;
// 1.Enum available FORMATETC structures
// 2.Set Data Advise specified to index ww
if (!ax->Data)
return 0;
IEnumFORMATETC* ief = 0;
int i = 0;
FORMATETC fe;
ax->Data->EnumFormatEtc((LPARAM)ll,&ief);
if (!ief)
return 0;
for(;;)
{
HRESULT hr = ief->Next(1,&fe,0);
if (hr != S_OK)
break;
if (ww == i)
break;
i++;
}
ief->Release();
if (ww == -1)
return i;
if (ax->Data)
ax->Data->DAdvise(&fe,0,&ax->Site,&ax->DAdviseToken[ww]);
return true;
}
if (mm == AX_GETAXINTERFACE)
{
AX* ax = (AX*)GetWindowLong(hh,GWL_USERDATA);
return (LONG)ax;
}
if (mm == AX_QUERYINTERFACE)
{
char* p = (char*)ww;
AX* ax = (AX*)GetWindowLong(hh,GWL_USERDATA);
if (!ax)
return 0;
return ax->OleObject->QueryInterface((REFIID)*p,(void**)ll);
}
if (mm == WM_LBUTTONDBLCLK)
{
PostMessage(hh,AX_INPLACE,1,0);
return 0;
}
if (mm == AX_INPLACE)
{
AX* ax = (AX*)GetWindowLong(hh,GWL_USERDATA);
if (!ax)
return 0;
if (!ax->OleObject)
return 0;
RECT rect;
HRESULT hr;
::GetClientRect(hh,&rect);
if (ax->Site.InPlace == false && ww == 1) // Activate In Place
{
ax->Site.InPlace = true;
ax->Site.ExternalPlace = ll;
hr = ax->OleObject->DoVerb(OLEIVERB_INPLACEACTIVATE,0,&ax->Site,0,hh,&rect);
InvalidateRect(hh,0,true);
return 1;
}
if (ax->Site.InPlace == true && ww == 0) // Deactivate
{
ax->Site.InPlace = false;
IOleInPlaceObject* iib;
ax->OleObject->QueryInterface(IID_IOleInPlaceObject,(void**)&iib);
if (iib)
{
iib->UIDeactivate();
iib->InPlaceDeactivate();
iib->Release();
InvalidateRect(hh,0,true);
return 1;
}
}
return 0;
}
if (mm == WM_SIZE)
{
AX* ax = (AX*)GetWindowLong(hh,GWL_USERDATA);
if (!ax)
return 0;
if (!ax->OleObject)
return 0;
DefWindowProc(hh,mm,ww,ll);
if (ax->Site.InPlace == true)
{
SendMessage(hh,AX_INPLACE,0,0);
InvalidateRect(hh,0,true);
SendMessage(hh,AX_INPLACE,1,0);
}
IOleInPlaceObject* pl;
ax->OleObject->QueryInterface(IID_IOleInPlaceObject,(void**)&pl);
if (!pl)
return 0;
RECT r;
GetClientRect(ax->Site.Window,&r);
pl->SetObjectRects(&r,&r);
pl->Release();
return 0;
}
return DefWindowProc(hh,mm,ww,ll);
}
// Registration function
ATOM AXRegister()
{
WNDCLASSEXA wC = {0};
wC.cbSize = sizeof(wC);
wC.style = CS_GLOBALCLASS | CS_DBLCLKS;
wC.lpfnWndProc = AXWndProc;
wC.cbWndExtra = 4;
wC.hInstance = GetModuleHandle(0);
wC.lpszClassName = "AX";
return RegisterClassExA(&wC);
}

142
ax.h Normal file
View File

@@ -0,0 +1,142 @@
// AX.H
// messages
#define AX_QUERYINTERFACE (WM_USER + 1)
#define AX_INPLACE (WM_USER + 2)
#define AX_GETAXINTERFACE (WM_USER + 3)
#define AX_CONNECTOBJECT (WM_USER + 4)
#define AX_DISCONNECTOBJECT (WM_USER + 5)
#define AX_SETDATAADVISE (WM_USER + 6)
#define AX_DOVERB (WM_USER + 7)
// Registration function
ATOM AXRegister();
// Class AXClientSide
class AXClientSite :
public IOleClientSite,
public IDispatch,
public IAdviseSink,
public IOleInPlaceSite,
public IOleInPlaceFrame
{
protected:
int refNum;
public:
HWND Window;
HWND Parent;
HMENU Menu;
bool InPlace;
bool ExternalPlace;
bool CalledCanInPlace;
class AX* ax;
// MyClientSite Methods
AXClientSite();
virtual ~AXClientSite();
STDMETHODIMP_(void) OnDataChange2(FORMATETC*);
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID iid,void**ppvObject);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
// IOleClientSite methods
STDMETHODIMP SaveObject();
STDMETHODIMP GetMoniker(DWORD dwA,DWORD dwW,IMoniker**pm);
STDMETHODIMP GetContainer(IOleContainer**pc);
STDMETHODIMP ShowObject();
STDMETHODIMP OnShowWindow(BOOL f);
STDMETHODIMP RequestNewObjectLayout();
// IAdviseSink methods
STDMETHODIMP_(void) OnDataChange(FORMATETC *pFormatEtc,STGMEDIUM *pStgmed);
STDMETHODIMP_(void) OnViewChange(DWORD dwAspect,LONG lIndex);
STDMETHODIMP_(void) OnRename(IMoniker * pmk);
STDMETHODIMP_(void) OnSave();
STDMETHODIMP_(void) OnClose();
// IOleInPlaceSite methods
STDMETHODIMP GetWindow(HWND *p);
STDMETHODIMP ContextSensitiveHelp(BOOL);
STDMETHODIMP CanInPlaceActivate();
STDMETHODIMP OnInPlaceActivate();
STDMETHODIMP OnUIActivate();
STDMETHODIMP GetWindowContext(IOleInPlaceFrame** ppFrame,IOleInPlaceUIWindow **ppDoc,LPRECT r1,LPRECT r2,LPOLEINPLACEFRAMEINFO o);
STDMETHODIMP Scroll(SIZE s);
STDMETHODIMP OnUIDeactivate(int);
STDMETHODIMP OnInPlaceDeactivate();
STDMETHODIMP DiscardUndoState();
STDMETHODIMP DeactivateAndUndo();
STDMETHODIMP OnPosRectChange(LPCRECT);
// IOleInPlaceFrame methods
STDMETHODIMP GetBorder(LPRECT l);
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS w);
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*pV,LPCOLESTR s);
STDMETHODIMP InsertMenus(HMENU h,LPOLEMENUGROUPWIDTHS x);
STDMETHODIMP SetMenu(HMENU h,HOLEMENU hO,HWND hw);
STDMETHODIMP RemoveMenus(HMENU h);
STDMETHODIMP SetStatusText(LPCOLESTR t);
STDMETHODIMP EnableModeless(BOOL f);
STDMETHODIMP TranslateAccelerator(LPMSG,WORD);
// IDispatch Methods
HRESULT _stdcall GetTypeInfoCount(unsigned int * pctinfo);
HRESULT _stdcall GetTypeInfo(unsigned int iTInfo,LCID lcid,ITypeInfo FAR* FAR* ppTInfo);
HRESULT _stdcall GetIDsOfNames(REFIID riid,OLECHAR FAR* FAR*,unsigned int cNames,LCID lcid,DISPID FAR* );
HRESULT _stdcall Invoke(DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS FAR* pDispParams,VARIANT FAR* pVarResult,EXCEPINFO FAR* pExcepInfo,unsigned int FAR* puArgErr);
// IOleControlSite Methods
};
// Class AX
class AX
{
public:
AX(char* clsid);
CLSID GetCLSID();
~AX();
void Init(char* clsid);
void Clean();
AXClientSite Site;
IID* iid;
IOleObject* OleObject;
IStorage* Storage;
IViewObject* View;
IDataObject* Data;
IUnknown* Unk;
IOleInPlaceActiveObject* Pao;
//AX_CONNECTSTRUCT* tcs;
bool AddMenu;
DWORD AdviseToken;
DWORD DAdviseToken[100];
private:
CLSID clsid;
};

BIN
content/cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
content/cursor2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More