Game Design -- including meaningful play, context, game state, and environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "OpenGLDebug.h" | |
| char const * GetOpenGLErrorString(GLenum const Error) | |
| { | |
| switch (Error) | |
| { | |
| case GL_NO_ERROR: | |
| return "GL_NO_ERROR"; | |
| case GL_INVALID_ENUM: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Standard LL | |
| IndexData.push_back(x + 0 + (GeometrySize + 1) * (y + 1)); | |
| IndexData.push_back(x + 1 + (GeometrySize + 1) * (y + 1)); | |
| IndexData.push_back(x + 0 + (GeometrySize + 1) * (y + 0)); | |
| // Standard UR | |
| IndexData.push_back(x + 1 + (GeometrySize + 1) * (y + 1)); | |
| IndexData.push_back(x + 1 + (GeometrySize + 1) * (y + 0)); | |
| IndexData.push_back(x + 0 + (GeometrySize + 1) * (y + 0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * OpenSimplex (Simplectic) Noise in C++ | |
| * by Arthur Tombs | |
| * | |
| * Modified 2015-01-08 | |
| * | |
| * This is a derivative work based on OpenSimplex by Kurt Spencer: | |
| * https://gist.github.com/KdotJPG/b1270127455a94ac5d19 | |
| * | |
| * Anyone is free to make use of this software in whatever way they want. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActiveCameraPosition = ActiveCamera->GetPosition() / 0.1f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vec3f const Translation = vec3f( | |
| (float) (Layer->ActiveRegion.Position.X * Layer->ScaleFactor * 0.1f - GlobalSystemOffset.X), | |
| 0.f, | |
| (float) (Layer->ActiveRegion.Position.Y * Layer->ScaleFactor * 0.1f - GlobalSystemOffset.Y)); | |
| vec3f const Scale = vec3f( | |
| (float) Layer->ScaleFactor * 0.1f, | |
| 0.1f, | |
| (float) Layer->ScaleFactor * 0.1f); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vec3f WorldCoordinates = vec3f(...); | |
| bool InFront; | |
| vec2i Coords = FreeCamera->GetScreenCoordinates(WorldCoordinates, &InFront); | |
| if (InFront) | |
| { | |
| GUIManager->Text(Coords, "Hello, World!"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void CApplication::OnEvent(IEvent & Event) | |
| { | |
| if (InstanceOf<SKeyboardEvent>(Event)) | |
| { | |
| SKeyboardEvent KeyboardEvent = As<SKeyboardEvent>(Event); | |
| if (! KeyboardEvent.Pressed) | |
| { | |
| switch (KeyboardEvent.Key) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CUniform<color3f> uColor = Colors::Red; | |
| ClothObjectFront->SetUniform("uColor", uColor); | |
| // later | |
| uColor = Colors::Blue; | |
| // (this automatically changes the uniform used by the cloth object) |