Compare commits

...

No commits in common. "labs" and "master" have entirely different histories.
labs ... master

16 changed files with 1265 additions and 30 deletions

63
.gitattributes vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

381
.gitignore vendored
View File

@ -1,34 +1,363 @@
# ---> C++
# Prerequisites
*.d
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Compiled Object files
*.slo
*.lo
*.o
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
# Precompiled Headers
*.gch
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Chutzpah Test files
_Chutzpah*
# Fortran module files
*.mod
*.smod
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Executables
*.exe
*.out
*.app
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
</configuration>

254
OpenGLTutorial11/Font.cs Normal file
View File

@ -0,0 +1,254 @@
using System;
using System.Collections.Generic;
using System.IO;
using OpenGL;
namespace OpenGLLabs
{
public class FontVAO : IDisposable
{
private ShaderProgram program;
private VBO<Vector3> vertices;
private VBO<Vector2> uvs;
private VBO<uint> triangles;
public Vector2 Position { get; set; }
public FontVAO(ShaderProgram program, VBO<Vector3> vertices, VBO<Vector2> uvs, VBO<uint> triangles)
{
this.program = program;
this.vertices = vertices;
this.uvs = uvs;
this.triangles = triangles;
}
public void Draw()
{
if (vertices == null) return;
program.Use();
program["model_matrix"].SetValue(Matrix4.CreateTranslation(new Vector3(Position.X, Position.Y, 0)));
Gl.BindBufferToShaderAttribute(vertices, program, "vertexPosition");
Gl.BindBufferToShaderAttribute(uvs, program, "vertexUV");
Gl.BindBuffer(triangles);
Gl.DrawElements(BeginMode.Triangles, triangles.Count, DrawElementsType.UnsignedInt, IntPtr.Zero);
}
public void Dispose()
{
vertices.Dispose();
uvs.Dispose();
triangles.Dispose();
vertices = null;
}
}
/// <summary>
/// The BMFont class can be used to load both the texture and data files associated with
/// the free BMFont tool (http://www.angelcode.com/products/bmfont/)
/// This tool allows
/// </summary>
public class BMFont
{
/// <summary>
/// Stores the ID, height, width and UV information for a single bitmap character
/// as exported by the BMFont tool.
/// </summary>
private struct Character
{
public char id;
public Vector2 texturePosition;
public Vector2 size;
public Vector2 bearing;
public int advance;
public Character(char id, Vector2 texturePosition, Vector2 size, Vector2 bearing, int advance)
{
this.id = id;
this.texturePosition = texturePosition;
this.size = size;
this.bearing = bearing;
this.advance = advance;
}
}
/// <summary>
/// Text justification to be applied when creating the VAO representing some text.
/// </summary>
public enum Justification
{
Left,
Center,
Right
}
/// <summary>
/// The font texture associated with this bitmap font.
/// </summary>
public Texture FontTexture { get; private set; }
private Dictionary<char, Character> characters = new Dictionary<char, Character>();
/// <summary>
/// The height (in pixels) of this bitmap font.
/// </summary>
public int Height { get; private set; }
/// <summary>
/// Loads both a font descriptor table and the associated texture as exported by BMFont.
/// </summary>
/// <param name="descriptorPath">The path to the font descriptor table.</param>
/// <param name="texturePath">The path to the font texture.</param>
public BMFont(string descriptorPath, string texturePath)
{
this.FontTexture = new Texture(texturePath);
using (StreamReader stream = new StreamReader(descriptorPath))
{
while (!stream.EndOfStream)
{
string line = stream.ReadLine();
if (line.StartsWith("char"))
{
// chars lets the program know how many characters are in this file, ignore it
if (line.StartsWith("chars")) continue;
// split up the different entries on this line to be parsed
string[] split = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
int id = 0, advance = 0;
float x = 0, y = 0, w = 0, h = 0, xoffset = 0, yoffset = 0;
// parse the contents of the line, looking for key words
for (int i = 0; i < split.Length; i++)
{
if (!split[i].Contains("=")) continue;
string code = split[i].Substring(0, split[i].IndexOf('='));
int value = int.Parse(split[i].Substring(split[i].IndexOf('=') + 1));
if (code == "id") id = value;
else if (code == "x") x = (float)value / FontTexture.Size.Width;
else if (code == "y") y = 1 - (float)value / FontTexture.Size.Height;
else if (code == "width") w = (float)value;
else if (code == "height")
{
h = (float)value;
this.Height = Math.Max(this.Height, value);
}
else if (code == "xoffset") xoffset = (float)value;
else if (code == "yoffset") yoffset = (float)value;
else if (code == "xadvance") advance = value;
}
// store this character into our dictionary (if it doesn't already exist)
Character c = new Character((char)id, new Vector2(x, y), new Vector2(w, h), new Vector2(xoffset, yoffset), advance);
if (!characters.ContainsKey(c.id)) characters.Add(c.id, c);
}
}
}
}
/// <summary>
/// Gets the width (in pixels) of a string of text using the current loaded font.
/// </summary>
/// <param name="text">The string of text to measure the width of.</param>
/// <returns>The width (in pixels) of the provided text.</returns>
public int GetWidth(string text)
{
int width = 0;
for (int i = 0; i < text.Length; i++)
width += (int)characters[characters.ContainsKey(text[i]) ? text[i] : ' '].advance;
return width;
}
public FontVAO CreateString(ShaderProgram program, string text, Justification justification = Justification.Left)
{
Vector3[] vertices = new Vector3[text.Length * 4];
Vector2[] uvs = new Vector2[text.Length * 4];
uint[] indices = new uint[text.Length * 6];
int xpos = 0, width = 0;
// calculate the initial x position depending on the justification
if (justification != Justification.Left)
{
for (int i = 0; i < text.Length; i++)
width += (int)characters[characters.ContainsKey(text[i]) ? text[i] : ' '].advance;
if (justification == Justification.Right) xpos = -width;
else xpos = -width / 2;
}
for (uint i = 0; i < text.Length; i++)
{
// grab the character, replacing with ' ' if the character isn't loaded
Character ch = characters[characters.ContainsKey(text[(int)i]) ? text[(int)i] : ' '];
vertices[i * 4 + 0] = new Vector3(xpos + ch.bearing.X, Height - ch.bearing.Y, 0);
vertices[i * 4 + 1] = new Vector3(xpos + ch.bearing.X, Height - (ch.bearing.Y + ch.size.Y), 0);
vertices[i * 4 + 2] = new Vector3(xpos + ch.bearing.X + ch.size.X, Height - ch.bearing.Y, 0);
vertices[i * 4 + 3] = new Vector3(xpos + ch.bearing.X + ch.size.X, Height - (ch.bearing.Y + ch.size.Y), 0);
xpos += ch.advance;
Vector2 bottomRight = ch.texturePosition
+ new Vector2(ch.size.X / FontTexture.Size.Width, -ch.size.Y / FontTexture.Size.Height);
uvs[i * 4 + 0] = new Vector2(ch.texturePosition.X, ch.texturePosition.Y);
uvs[i * 4 + 1] = new Vector2(ch.texturePosition.X, bottomRight.Y);
uvs[i * 4 + 2] = new Vector2(bottomRight.X, ch.texturePosition.Y);
uvs[i * 4 + 3] = new Vector2(bottomRight.X, bottomRight.Y);
indices[i * 6 + 0] = i * 4 + 2;
indices[i * 6 + 1] = i * 4 + 0;
indices[i * 6 + 2] = i * 4 + 1;
indices[i * 6 + 3] = i * 4 + 3;
indices[i * 6 + 4] = i * 4 + 2;
indices[i * 6 + 5] = i * 4 + 1;
}
// Create the vertex buffer objects and then create the array object
return new FontVAO(program, new VBO<Vector3>(vertices), new VBO<Vector2>(uvs), new VBO<uint>(indices, BufferTarget.ElementArrayBuffer));
}
public static string FontVertexSource = @"
#version 130
uniform mat4 model_matrix;
uniform mat4 ortho_matrix;
in vec3 vertexPosition;
in vec2 vertexUV;
out vec2 uv;
void main(void)
{
uv = vertexUV;
gl_Position = ortho_matrix * model_matrix * vec4(vertexPosition, 1);
}";
public static string FontFragmentSource = @"
#version 130
uniform sampler2D texture;
uniform vec3 color;
in vec2 uv;
out vec4 fragment;
void main(void)
{
vec4 texel = texture2D(texture, uv);
fragment = vec4(texel.rgb * color, texel.a);
}
";
}
}

249
OpenGLTutorial11/Program.cs Normal file
View File

@ -0,0 +1,249 @@
using System;
using System.Collections.Generic;
using Tao.FreeGlut;
using OpenGL;
namespace OpenGLLabs
{
class Program
{
private static int width = 1280, height = 720;
private static System.Diagnostics.Stopwatch watch;
private static bool fullscreen = false;
private static bool left, right, up, down;
private static float theta = (float)Math.PI / 2, phi = (float)Math.PI / 2;
private static ShaderProgram program;
private static VBO<Vector3> flagVertices;
private static VBO<Vector2> flagUVs;
private static VBO<uint> flagTriangles;
private static float flagTime;
private static Texture flagTexture;
private static BMFont font;
private static ShaderProgram fontProgram;
private static FontVAO information;
static void Main(string[] args)
{
Glut.glutInit();
Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_DEPTH);
Glut.glutInitWindowSize(width, height);
Glut.glutCreateWindow("OpenGL Labs");
Glut.glutIdleFunc(OnRenderFrame);
Glut.glutDisplayFunc(OnDisplay);
Glut.glutKeyboardFunc(OnKeyboardDown);
Glut.glutKeyboardUpFunc(OnKeyboardUp);
Glut.glutCloseFunc(OnClose);
Glut.glutReshapeFunc(OnReshape);
// enable blending and set to accumulate the star colors
Gl.Enable(EnableCap.DepthTest);
Gl.Enable(EnableCap.Blend);
// create our shader program
program = new ShaderProgram(VertexShader, FragmentShader);
// set up the projection and view matrix
program.Use();
program["projection_matrix"].SetValue(Matrix4.CreatePerspectiveFieldOfView(0.45f, (float)width / height, 0.1f, 1000f));
program["view_matrix"].SetValue(Matrix4.LookAt(new Vector3(0, 0, 20), Vector3.Zero, new Vector3(0, 1, 0)));
program["model_matrix"].SetValue(Matrix4.Identity);
// load the flag texture
flagTexture = new Texture("flag.jpg");
// create the flag, which is just a plane with a certain number of segments
List<Vector3> vertices = new List<Vector3>();
List<Vector2> uvs = new List<Vector2>();
List<uint> triangles = new List<uint>();
for (int x = 0; x < 40; x++)
{
for (int y = 0; y < 40; y++)
{
vertices.Add(new Vector3((x - 20) / 5.0f, (y - 20) / 10.0f, 0));
uvs.Add(new Vector2(x / 39.0f, 1 - y / 39.0f));
if (y == 39 || x == 39) continue;
triangles.Add((uint)(x * 40 + y));
triangles.Add((uint)((x + 1) * 40 + y));
triangles.Add((uint)((x + 1) * 40 + y + 1));
triangles.Add((uint)(x * 40 + y));
triangles.Add((uint)((x + 1) * 40 + y + 1));
triangles.Add((uint)(x * 40 + y + 1));
}
}
flagVertices = new VBO<Vector3>(vertices.ToArray());
flagUVs = new VBO<Vector2>(uvs.ToArray());
flagTriangles = new VBO<uint>(triangles.ToArray(), BufferTarget.ElementArrayBuffer);
// load the bitmap font for this tutorial
font = new BMFont("font24.fnt", "font24.png");
fontProgram = new ShaderProgram(BMFont.FontVertexSource, BMFont.FontFragmentSource);
fontProgram.Use();
fontProgram["ortho_matrix"].SetValue(Matrix4.CreateOrthographic(width, height, 0, 1000));
fontProgram["color"].SetValue(new Vector3(1, 1, 1));
information = font.CreateString(fontProgram, "Trailer: DORMITORY | Kashin Maxim | PIbd-32");
watch = System.Diagnostics.Stopwatch.StartNew();
Glut.glutMainLoop();
}
private static void OnClose()
{
flagVertices.Dispose();
flagUVs.Dispose();
flagTriangles.Dispose();
flagTexture.Dispose();
program.DisposeChildren = true;
program.Dispose();
fontProgram.DisposeChildren = true;
fontProgram.Dispose();
font.FontTexture.Dispose();
information.Dispose();
}
private static void OnDisplay()
{
}
private static void OnRenderFrame()
{
watch.Stop();
float deltaTime = (float)watch.ElapsedTicks / System.Diagnostics.Stopwatch.Frequency;
watch.Restart();
// perform rotation of the scene depending on keyboard input
if (right) phi += deltaTime;
if (left) phi -= deltaTime;
if (up) theta += deltaTime;
if (down) theta -= deltaTime;
if (theta < 0) theta += (float)Math.PI * 2;
// set up the viewport and clear the previous depth and color buffers
Gl.Viewport(0, 0, width, height);
Gl.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
// make sure the shader program and texture are being used
Gl.UseProgram(program.ProgramID);
Gl.BindTexture(flagTexture);
// calculate the camera position using some fancy polar co-ordinates
Vector3 position = 20 * new Vector3((float)(Math.Cos(phi) * Math.Sin(theta)), (float)Math.Cos(theta), (float)(Math.Sin(phi) * Math.Sin(theta)));
Vector3 upVector = ((theta % (Math.PI * 2)) > Math.PI) ? new Vector3(0, 1, 0) : new Vector3(0, -1, 0);
program["view_matrix"].SetValue(Matrix4.LookAt(position, Vector3.Zero, upVector));
program["time"].SetValue(flagTime);
flagTime += deltaTime;
Gl.BindBufferToShaderAttribute(flagVertices, program, "vertexPosition");
Gl.BindBufferToShaderAttribute(flagUVs, program, "vertexUV");
Gl.BindBuffer(flagTriangles);
Gl.DrawElements(BeginMode.Triangles, flagTriangles.Count, DrawElementsType.UnsignedInt, IntPtr.Zero);
// bind the font program as well as the font texture
Gl.UseProgram(fontProgram.ProgramID);
Gl.BindTexture(font.FontTexture);
// build this string every frame, since theta and phi can change
FontVAO vao = font.CreateString(fontProgram, string.Format("Attempts to pass: {2:0}", theta, phi, flagTime), BMFont.Justification.Right);
vao.Position = new Vector2(130 , - height / 4);
vao.Draw();
vao.Dispose();
// draw the tutorial information, which is static
information.Draw();
Glut.glutSwapBuffers();
}
private static void OnReshape(int width, int height)
{
Program.width = width;
Program.height = height;
Gl.UseProgram(program.ProgramID);
program["projection_matrix"].SetValue(Matrix4.CreatePerspectiveFieldOfView(0.45f, (float)width / height, 0.1f, 1000f));
Gl.UseProgram(fontProgram.ProgramID);
fontProgram["ortho_matrix"].SetValue(Matrix4.CreateOrthographic(width, height, 0, 1000));
information.Position = new Vector2(-265, height / 5);
}
private static void OnKeyboardDown(byte key, int x, int y)
{
if (key == 'w') up = true;
else if (key == 's') down = true;
else if (key == 'd') right = true;
else if (key == 'a') left = true;
else if (key == 27) Glut.glutLeaveMainLoop();
}
private static void OnKeyboardUp(byte key, int x, int y)
{
if (key == 'w') up = false;
else if (key == 's') down = false;
else if (key == 'd') right = false;
else if (key == 'a') left = false;
else if (key == 'f')
{
fullscreen = !fullscreen;
if (fullscreen) Glut.glutFullScreen();
else
{
Glut.glutPositionWindow(0, 0);
Glut.glutReshapeWindow(1280, 720);
}
}
}
public static string VertexShader = @"
#version 130
in vec3 vertexPosition;
in vec2 vertexUV;
out vec2 uv;
uniform mat4 projection_matrix;
uniform mat4 view_matrix;
uniform mat4 model_matrix;
uniform float time;
void main(void)
{
uv = vertexUV;
float displace = sin(time * 2 + vertexPosition.x) / 3;
gl_Position = projection_matrix * view_matrix * model_matrix * vec4(vertexPosition.x, vertexPosition.y, displace, 1);
}
";
public static string FragmentShader = @"
#version 130
uniform sampler2D texture;
in vec2 uv;
out vec4 fragment;
void main(void)
{
fragment = vec4(texture2D(texture, uv).xyz, 1);
}
";
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGLLabs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGLLabs")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7a944ec4-ebef-4b12-af4c-58c4c7553334")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,197 @@
info face="Consolas" size=-24 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=1
common lineHeight=28 base=22 scaleW=512 scaleH=512 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
page id=0 file="font24_0.png"
chars count=193
char id=0 x=127 y=155 width=5 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=13 x=507 y=0 width=0 height=28 xoffset=0 yoffset=0 xadvance=0 page=0 chnl=15
char id=32 x=121 y=155 width=5 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=33 x=98 y=155 width=7 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=34 x=398 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=35 x=443 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=36 x=154 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=37 x=193 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=38 x=210 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=39 x=504 y=93 width=7 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=40 x=481 y=124 width=10 height=30 xoffset=2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=41 x=470 y=124 width=10 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=42 x=168 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=43 x=32 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=44 x=72 y=155 width=9 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=45 x=410 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=46 x=90 y=155 width=7 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=47 x=182 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=48 x=80 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=49 x=196 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=50 x=45 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=51 x=210 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=52 x=128 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=53 x=308 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=54 x=140 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=55 x=255 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=56 x=448 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=57 x=240 y=62 width=14 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=58 x=82 y=155 width=7 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=59 x=52 y=155 width=9 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=60 x=194 y=124 width=12 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=61 x=476 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=62 x=220 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=63 x=0 y=155 width=10 height=30 xoffset=2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=64 x=329 y=0 width=16 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=65 x=346 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=66 x=490 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=67 x=165 y=62 width=14 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=68 x=30 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=69 x=298 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=70 x=337 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=71 x=224 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=72 x=225 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=73 x=0 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=74 x=233 y=124 width=12 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=75 x=150 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=76 x=272 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=77 x=192 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=78 x=497 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=79 x=208 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=80 x=15 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=81 x=261 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=82 x=60 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=83 x=14 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=84 x=256 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=85 x=195 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=86 x=18 y=0 width=17 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=87 x=272 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=88 x=288 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=89 x=0 y=0 width=17 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=90 x=270 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=91 x=22 y=155 width=9 height=30 xoffset=2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=92 x=28 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=93 x=11 y=155 width=10 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=94 x=42 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=95 x=90 y=0 width=17 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=96 x=62 y=155 width=9 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=97 x=56 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=98 x=126 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=99 x=315 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=100 x=329 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=101 x=343 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=102 x=112 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=103 x=144 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=104 x=357 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=105 x=371 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=106 x=259 y=124 width=12 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=107 x=0 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=108 x=385 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=109 x=304 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=110 x=399 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=111 x=363 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=112 x=413 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=113 x=427 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=114 x=441 y=62 width=13 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=115 x=455 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=116 x=210 y=62 width=14 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=117 x=469 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=118 x=240 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=119 x=336 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=120 x=459 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=121 x=16 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=122 x=483 y=62 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=123 x=285 y=124 width=12 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=124 x=145 y=155 width=5 height=30 xoffset=4 yoffset=-1 xadvance=13 page=0 chnl=15
char id=125 x=207 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=126 x=160 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=160 x=139 y=155 width=5 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=161 x=106 y=155 width=7 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=162 x=168 y=124 width=12 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=163 x=120 y=62 width=14 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=164 x=176 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=165 x=96 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=166 x=133 y=155 width=5 height=30 xoffset=4 yoffset=-1 xadvance=13 page=0 chnl=15
char id=167 x=0 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=168 x=350 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=169 x=72 y=0 width=17 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=170 x=422 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=171 x=14 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=172 x=28 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=173 x=434 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=174 x=352 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=175 x=42 y=155 width=9 height=30 xoffset=2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=176 x=446 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=177 x=320 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=178 x=362 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=179 x=458 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=180 x=32 y=155 width=9 height=30 xoffset=4 yoffset=-1 xadvance=13 page=0 chnl=15
char id=181 x=285 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=182 x=42 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=183 x=503 y=124 width=7 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=184 x=114 y=155 width=6 height=30 xoffset=3 yoffset=-1 xadvance=13 page=0 chnl=15
char id=185 x=374 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=186 x=386 y=124 width=11 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=187 x=56 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=188 x=176 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=189 x=108 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=190 x=125 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=191 x=492 y=124 width=10 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=192 x=159 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=193 x=142 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=194 x=312 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=195 x=278 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=196 x=244 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=197 x=227 y=0 width=16 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=198 x=36 y=0 width=17 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=199 x=495 y=31 width=14 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=200 x=181 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=201 x=246 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=202 x=324 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=203 x=311 y=124 width=12 height=30 xoffset=1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=204 x=70 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=205 x=84 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=206 x=98 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=207 x=322 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=208 x=295 y=0 width=16 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=209 x=112 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=210 x=0 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=211 x=491 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=212 x=475 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=213 x=427 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=214 x=411 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=215 x=126 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=216 x=395 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=217 x=480 y=31 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=218 x=75 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=219 x=90 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=220 x=105 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=221 x=54 y=0 width=17 height=30 xoffset=-2 yoffset=-1 xadvance=13 page=0 chnl=15
char id=222 x=135 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=223 x=300 y=62 width=14 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=224 x=224 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=225 x=238 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=226 x=252 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=227 x=266 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=228 x=280 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=229 x=294 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=230 x=384 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=231 x=154 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=232 x=336 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=233 x=350 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=234 x=364 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=235 x=378 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=236 x=392 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=237 x=406 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=238 x=420 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=239 x=434 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=240 x=180 y=62 width=14 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=241 x=462 y=93 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=242 x=400 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=243 x=416 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=244 x=432 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=245 x=448 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=246 x=464 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=247 x=379 y=0 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=248 x=64 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=249 x=70 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=250 x=84 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=251 x=98 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=252 x=112 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=253 x=368 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15
char id=254 x=140 y=124 width=13 height=30 xoffset=0 yoffset=-1 xadvance=13 page=0 chnl=15
char id=255 x=48 y=31 width=15 height=30 xoffset=-1 yoffset=-1 xadvance=13 page=0 chnl=15

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{68D73A6C-EBEF-4CB9-A421-C4B61F16C020}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenGLLabs</RootNamespace>
<AssemblyName>OpenGLLabs</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenGL">
<HintPath>libs\OpenGL.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="Tao.FreeGlut">
<HintPath>libs\Tao.FreeGlut.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Font.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(ProjectDir)\libs\*" "$(TargetDir)"
copy "$(ProjectDir)\data\*" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.

View File

@ -0,0 +1,7 @@
<configuration>
<dllmap dll="opengl32.dll">
<dllmap os="linux" dll="libGL.so.1"/>
<dllentry os="windows" dll="opengl32.dll" />
<dllentry os="osx" dll="opengl32.dll" />
</dllmap>
</configuration>

Binary file not shown.

View File

@ -0,0 +1,7 @@
<configuration>
<dllmap dll="freeglut.dll">
<dllentry os="linux" dll="libglut.so.3" />
<dllentry os="windows" dll="freeglut.dll" />
<dllentry os="osx" dll="/System/Library/Frameworks/GLUT.framework/GLUT" />
</dllmap>
</configuration>

Binary file not shown.

View File

@ -1,4 +0,0 @@
# PIbd-32_Kashin_M.I_CG_OpenGL
Лабораторная работа по OpenGL.
Дисциплина: Компьютетная графика

22
labs.sln Normal file
View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "labs", "OpenGLTutorial11\labs.csproj", "{68D73A6C-EBEF-4CB9-A421-C4B61F16C020}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{68D73A6C-EBEF-4CB9-A421-C4B61F16C020}.Debug|x86.ActiveCfg = Debug|x86
{68D73A6C-EBEF-4CB9-A421-C4B61F16C020}.Debug|x86.Build.0 = Debug|x86
{68D73A6C-EBEF-4CB9-A421-C4B61F16C020}.Release|x86.ActiveCfg = Release|x86
{68D73A6C-EBEF-4CB9-A421-C4B61F16C020}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal