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 Terrain::generateIndices() { | |
| // we calculate the amount of levels and make the index buffers | |
| int level_max = log2(patch_size - 1); | |
| indexCount = new GLuint[level_max + 1]; | |
| indexBuffer = new GLuint[level_max + 1]; | |
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
| header = UILabel.alloc.initWithFrame([[20, 260], [view.frame.size.width - 20 * 2, 40]]) | |
| #=> expected instance of `CGPoint', got `20' (Fixnum) (TypeError) |
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
| // ----------------------------------------------------------------------------- | |
| // BYN SOFTWARE, COPYRIGHT 2012 | |
| // | |
| // Author: Jan-Willem Buurlage et al. | |
| // Contact: j.buurlage@students.uu.nl | |
| // | |
| // Part of the Starry project, an astronomy application for the regular user, | |
| // for the iPad and iPhone. | |
| // ----------------------------------------------------------------------------- |
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
| // ----------------------------------------------------------------------------- | |
| // BYN SOFTWARE, COPYRIGHT 2012 | |
| // | |
| // Author: Jan-Willem Buurlage et al. | |
| // Contact: j.buurlage@students.uu.nl | |
| // | |
| // Part of the Starry project, an astronomy application for the regular user, | |
| // for the iPad and iPhone. | |
| // ----------------------------------------------------------------------------- |
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
| module TicTacToe | |
| class Board | |
| def initialize | |
| @grid = Array.new(9, -1) | |
| end | |
| def move(square, player) | |
| return false unless @grid[square] == -1 | |
| @grid[square] = player | |
| end |
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
| module SeaBattle | |
| class Board | |
| def initialize | |
| @grid = Array.new(100, 0) | |
| end | |
| def set_boat(i, j, o, length) | |
| # o = orientation, 0 = right, 1 = down | |
| if(o == 0) | |
| for x in j...(j+length) |
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
| // relevant code before the call | |
| // ... | |
| glUseProgram(PROG_POINT); | |
| glUniformMatrix4fv(LOC_POINT_MVP, 1, GL_FALSE, modelViewProjectionMatrix.m); | |
| glUniform1i(LOC_POINT_TEXTURE, 0); | |
| glUniform4f(LOC_POINT_COLOR, 1.0f, 1.0f, 1.0f, 1.0f); | |
| glBindBuffer(GL_ARRAY_BUFFER, some_vertex_buffer); | |
| glEnableVertexAttribArray(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
| SRInterfaceController* interface = [[SRInterfaceController alloc] init]; | |
| SomeGLKViewController* glVC = [[SomeGLKViewController alloc] initWithNibName:nil bundle:nil]; | |
| starVC.preferredFramesPerSecond = 60; | |
| [mainVC addChildViewController:interface]; | |
| [mainVC addChildViewController:glVC]; | |
| [[mainVC view] addSubview:[glVC view]]; | |
| [[mainVC view] addSubview:[interface view]]; |
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
| glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); | |
| glUniformMatrix4fv(LOC_BASIC_MVP, 1, GL_FALSE, GLKMatrix4Identity.m); | |
| glUniform4f(LOC_BASIC_COLOR, 1.0f, 0.0f, 0.0f, 1.0f); | |
| glBindBuffer(GL_ARRAY_BUFFER, unit_square_vertex_buffer); | |
| glEnableVertexAttribArray(0); | |
| glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float),(GLvoid*)0); | |
| glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); |
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
| # ------------------------------------------------------------------------------ | |
| # dit is een proc | |
| check = lambda do |i| | |
| (i <= 5) # returned false als i > 5 | |
| end | |
| # we callen de proc voor alle i in 1..6 |
OlderNewer