Changeset 92b1e90 in opengl-game for new-game.cpp
- Timestamp:
- Jul 13, 2018, 4:00:42 AM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 6877ef3
- Parents:
- b155f13
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
rb155f13 r92b1e90 34 34 using namespace glm; 35 35 36 /* LASERS TODO: 37 * -Allow lasers that face any direction 38 * -Make the lasers rotate to always face the camera 39 * -Use textures to draw lasers 40 * -The textures should be grayscale and have transparency 41 * -The laser shader should take an input color to blend with the texture to give the lasers color 42 * -The lasers should be SceneObjects and drawn like all other objects 43 * -Make lasers shoot from the ends of the ship's wings when the user presses a button and disappear after a second or so 44 */ 45 46 enum State { 47 STATE_MAIN_MENU, 48 STATE_GAME, 49 }; 50 51 enum Event { 52 EVENT_GO_TO_MAIN_MENU, 53 EVENT_GO_TO_GAME, 54 EVENT_QUIT, 55 }; 56 57 enum ObjectType { 58 TYPE_SHIP, 59 TYPE_ASTEROID, 60 TYPE_LASER, 61 }; 62 36 63 struct SceneObject { 37 64 unsigned int id; 65 ObjectType type; 38 66 39 67 // Currently, model_transform should only have translate, and rotation and scale need to be done in model_base since … … 65 93 }; 66 94 67 enum State {68 STATE_MAIN_MENU,69 STATE_GAME,70 };71 72 enum Event {73 EVENT_GO_TO_MAIN_MENU,74 EVENT_GO_TO_GAME,75 EVENT_QUIT,76 };77 78 95 void glfw_error_callback(int error, const char* description); 79 96 … … 99 116 GLuint normals_vbo, 100 117 GLuint ubo, 101 GLuint model_mat_idx_vbo); 102 void removeObjectFromScene(SceneObject& obj, GLuint ubo); 103 104 void calculateObjectBoundingBox(SceneObject& obj); 105 106 void addLaserToScene(vec3 start, vec3 end, vec3 color, 107 GLfloat width, 108 unsigned int& num_lasers, 118 GLuint model_mat_idx_vbo, 109 119 GLuint laser_points_vbo, 110 120 GLuint laser_colors_vbo); 121 void removeObjectFromScene(SceneObject& obj, GLuint ubo); 122 123 void calculateObjectBoundingBox(SceneObject& obj); 124 125 void addLaserToScene(SceneObject& obj, vec3 start, vec3 end, vec3 color, GLfloat width); 111 126 112 127 void initializeBuffers( … … 117 132 GLuint* normals_vbo, 118 133 GLuint* ubo, 119 GLuint* model_mat_idx_vbo); 134 GLuint* model_mat_idx_vbo, 135 GLuint* laser_points_vbo, 136 GLuint* laser_colors_vbo); 120 137 121 138 void populateBuffers(vector<SceneObject>& objects, … … 127 144 GLuint normals_vbo, 128 145 GLuint ubo, 129 GLuint model_mat_idx_vbo); 146 GLuint model_mat_idx_vbo, 147 GLuint laser_points_vbo, 148 GLuint laser_colors_vbo); 130 149 131 150 void copyObjectDataToBuffers(SceneObject& obj, … … 137 156 GLuint normals_vbo, 138 157 GLuint ubo, 139 GLuint model_mat_idx_vbo); 158 GLuint model_mat_idx_vbo, 159 GLuint laser_points_vbo, 160 GLuint laser_colors_vbo); 140 161 141 162 void transformObject(SceneObject& obj, const mat4& transform, GLuint ubo); … … 144 165 void renderMainMenuGui(); 145 166 146 void renderScene( vector<SceneObject>& objects,147 GLuint color_sp, GLuint texture_sp, 148 GLuint vao1, GLuint vao2,167 void renderScene(map<GLuint, BufferInfo>& shaderBufferInfo, 168 GLuint color_sp, GLuint texture_sp, GLuint laser_sp, 169 GLuint color_vao, GLuint texture_vao, GLuint laser_vao, 149 170 GLuint colors_vbo, GLuint selected_colors_vbo, 150 SceneObject* selectedObject, 151 map<GLuint, BufferInfo>& shaderBufferInfo); 152 void renderLasers(GLuint sp, GLuint vao, unsigned int numLasers); 171 SceneObject* selectedObject); 153 172 void renderSceneGui(); 154 173 … … 161 180 GLuint normals_vbo, 162 181 GLuint ubo, 163 GLuint model_mat_idx_vbo); 182 GLuint model_mat_idx_vbo, 183 GLuint laser_points_vbo, 184 GLuint laser_colors_vbo); 164 185 165 186 float getRandomNum(float low, float high); … … 359 380 SceneObject obj; 360 381 mat4 T_model, R_model; 382 383 // TODO: Confirm there's nothing I need from the commented out models and delete them 384 // (Check to make sure the textured square is drawn correctly) 361 385 362 386 /* … … 434 458 // player ship 435 459 obj = SceneObject(); 460 obj.type = TYPE_SHIP; 436 461 obj.shader_program = color_sp; 437 462 obj.points = { … … 812 837 addObjectToSceneDuringInit(obj); 813 838 839 obj = SceneObject(); 840 obj.shader_program = laser_sp; 841 842 addLaserToScene(obj, vec3(0.34f, -2.0f, 1.6f), vec3(0.34f, -2.0f, -3.0f), vec3(0.0f, 1.0f, 0.0f), 0.04f); 843 844 obj = SceneObject(); 845 obj.shader_program = laser_sp; 846 847 addLaserToScene(obj, vec3(-0.34f, -2.0f, 1.6f), vec3(-0.34f, -2.0f, -3.0f), vec3(0.0f, 1.0f, 0.0f), 0.04f); 848 814 849 vector<SceneObject>::iterator obj_it; 815 850 816 851 GLuint points_vbo, colors_vbo, selected_colors_vbo, texcoords_vbo, 817 normals_vbo, ubo, model_mat_idx_vbo ;852 normals_vbo, ubo, model_mat_idx_vbo, laser_points_vbo, laser_colors_vbo; 818 853 819 854 initializeBuffers( … … 824 859 &normals_vbo, 825 860 &ubo, 826 &model_mat_idx_vbo); 861 &model_mat_idx_vbo, 862 &laser_points_vbo, 863 &laser_colors_vbo); 827 864 828 865 populateBuffers(objects, … … 834 871 normals_vbo, 835 872 ubo, 836 model_mat_idx_vbo); 837 838 unsigned int max_num_lasers = 20; 839 unsigned int num_lasers = 0; 840 841 GLuint laser_points_vbo = 0; 842 glGenBuffers(1, &laser_points_vbo); 843 glBindBuffer(GL_ARRAY_BUFFER, laser_points_vbo); 844 glBufferData(GL_ARRAY_BUFFER, max_num_lasers * 18 * sizeof(GLfloat) * 3, NULL, GL_DYNAMIC_DRAW); 845 846 GLuint laser_colors_vbo = 0; 847 glGenBuffers(1, &laser_colors_vbo); 848 glBindBuffer(GL_ARRAY_BUFFER, laser_colors_vbo); 849 glBufferData(GL_ARRAY_BUFFER, max_num_lasers * 18 * sizeof(GLfloat) * 3, NULL, GL_DYNAMIC_DRAW); 850 851 addLaserToScene(vec3(0.34f, -2.0f, 1.6f), vec3(0.34f, -2.0f, -3.0f), vec3(0.0f, 1.0f, 0.0f), 0.04f, 852 num_lasers, laser_points_vbo, laser_colors_vbo); 853 addLaserToScene(vec3(-0.34f, -2.0f, 1.6f), vec3(-0.34f, -2.0f, -3.0f), vec3(0.0f, 1.0f, 0.0f), 0.04f, 854 num_lasers, laser_points_vbo, laser_colors_vbo); 855 856 GLuint vao = 0; 857 glGenVertexArrays(1, &vao); 858 glBindVertexArray(vao); 873 model_mat_idx_vbo, 874 laser_points_vbo, 875 laser_colors_vbo); 876 877 GLuint color_vao = 0; 878 glGenVertexArrays(1, &color_vao); 879 glBindVertexArray(color_vao); 859 880 860 881 glEnableVertexAttribArray(0); … … 872 893 glVertexAttribIPointer(3, 1, GL_UNSIGNED_INT, 0, 0); 873 894 874 GLuint vao2= 0;875 glGenVertexArrays(1, & vao2);876 glBindVertexArray( vao2);895 GLuint texture_vao = 0; 896 glGenVertexArrays(1, &texture_vao); 897 glBindVertexArray(texture_vao); 877 898 878 899 glEnableVertexAttribArray(0); … … 1045 1066 normals_vbo, 1046 1067 ubo, 1047 model_mat_idx_vbo); 1068 model_mat_idx_vbo, 1069 laser_points_vbo, 1070 laser_colors_vbo); 1048 1071 1049 1072 elapsed_seconds_spawn -= 0.5f; … … 1078 1101 } 1079 1102 1080 for (int i = 1; i < objects.size(); i++) { 1081 if (!objects[i].deleted) { 1103 // this code moves the asteroids 1104 for (int i = 0; i < objects.size(); i++) { 1105 if (objects[i].type == TYPE_ASTEROID && !objects[i].deleted) { 1082 1106 transformObject(objects[i], translate(mat4(1.0f), vec3(0.0f, 0.0f, 0.04f)), ubo); 1083 1107 … … 1175 1199 break; 1176 1200 case STATE_GAME: 1177 renderScene( objects,1178 color_sp, texture_sp, 1179 vao, vao2,1201 renderScene(shaderBufferInfo, 1202 color_sp, texture_sp, laser_sp, 1203 color_vao, texture_vao, laser_vao, 1180 1204 colors_vbo, selected_colors_vbo, 1181 selectedObject, 1182 shaderBufferInfo); 1183 renderLasers(laser_sp, laser_vao, num_lasers); 1205 selectedObject); 1184 1206 renderSceneGui(); 1185 1207 break; … … 1227 1249 1228 1250 for (vector<SceneObject>::iterator it = objects.begin(); it != objects.end(); it++) { 1251 if (it->type == TYPE_LASER) continue; 1229 1252 for (unsigned int p_idx = 0; p_idx < it->points.size(); p_idx += 9) { 1230 1253 if (faceClicked( … … 1434 1457 GLuint normals_vbo, 1435 1458 GLuint ubo, 1436 GLuint model_mat_idx_vbo) { 1459 GLuint model_mat_idx_vbo, 1460 GLuint laser_points_vbo, 1461 GLuint laser_colors_vbo) { 1437 1462 addObjectToSceneDuringInit(obj); 1438 1463 … … 1450 1475 normals_vbo, 1451 1476 ubo, 1452 model_mat_idx_vbo); 1477 model_mat_idx_vbo, 1478 laser_points_vbo, 1479 laser_colors_vbo); 1453 1480 } else { 1454 1481 copyObjectDataToBuffers(objects.back(), shaderBufferInfo, … … 1459 1486 normals_vbo, 1460 1487 ubo, 1461 model_mat_idx_vbo); 1488 model_mat_idx_vbo, 1489 laser_points_vbo, 1490 laser_colors_vbo); 1462 1491 } 1463 1492 } … … 1527 1556 1528 1557 // currently only works correctly for lasers oriented along the z axis 1529 void addLaserToScene(vec3 start, vec3 end, vec3 color, GLfloat width, unsigned int& num_lasers, 1530 GLuint laser_points_vbo, GLuint laser_colors_vbo) { 1531 GLuint size_in_buffer = 18 * sizeof(GLfloat) * 3; 1558 void addLaserToScene(SceneObject& obj, vec3 start, vec3 end, vec3 color, GLfloat width) { 1559 obj.id = objects.size(); // currently unused 1560 obj.type = TYPE_LASER; 1561 obj.deleted = false; 1532 1562 1533 1563 // I really need to create a direction vector and add/subtract that from start and end … … 1536 1566 vec3 dir = end - start; 1537 1567 1538 vector<GLfloat> laser_points = {1539 end.x + width / 2, end.y,start.z - width,1540 end.x - width / 2, end.y,start.z - width,1568 obj.points = { 1569 start.x + width / 2, start.y, start.z - width, 1570 start.x - width / 2, start.y, start.z - width, 1541 1571 start.x - width / 2, start.y, start.z, 1542 end.x + width / 2, end.y,start.z - width,1572 start.x + width / 2, start.y, start.z - width, 1543 1573 start.x - width / 2, start.y, start.z, 1544 1574 start.x + width / 2, start.y, start.z, … … 1551 1581 end.x + width / 2, end.y, end.z, 1552 1582 end.x - width / 2, end.y, end.z, 1553 start.x - width / 2, start.y,end.z + width,1583 end.x - width / 2, end.y, end.z + width, 1554 1584 end.x + width / 2, end.y, end.z, 1555 start.x - width / 2, start.y,end.z + width,1556 start.x + width / 2, start.y,end.z + width,1585 end.x - width / 2, end.y, end.z + width, 1586 end.x + width / 2, end.y, end.z + width, 1557 1587 }; 1558 1588 1559 1589 vec3 end_color = vec3(1.0f, 0.0f, 0.0f); // temporary 1560 vector<GLfloat> laser_colors = {1590 obj.colors = { 1561 1591 end_color.x, end_color.y, end_color.z, 1562 1592 end_color.x, end_color.y, end_color.z, … … 1579 1609 }; 1580 1610 1581 glBindBuffer(GL_ARRAY_BUFFER, laser_points_vbo); 1582 glBufferSubData(GL_ARRAY_BUFFER, num_lasers * size_in_buffer, size_in_buffer, &laser_points[0]); 1583 1584 glBindBuffer(GL_ARRAY_BUFFER, laser_colors_vbo); 1585 glBufferSubData(GL_ARRAY_BUFFER, num_lasers * size_in_buffer, size_in_buffer, &laser_colors[0]); 1586 1587 num_lasers++; 1611 obj.num_points = obj.points.size() / 3; 1612 1613 objects.push_back(obj); 1588 1614 } 1589 1615 … … 1595 1621 GLuint* normals_vbo, 1596 1622 GLuint* ubo, 1597 GLuint* model_mat_idx_vbo) { 1623 GLuint* model_mat_idx_vbo, 1624 GLuint* laser_points_vbo, 1625 GLuint* laser_colors_vbo) { 1598 1626 *points_vbo = 0; 1599 1627 glGenBuffers(1, points_vbo); … … 1616 1644 *model_mat_idx_vbo = 0; 1617 1645 glGenBuffers(1, model_mat_idx_vbo); 1646 1647 *laser_points_vbo = 0; 1648 glGenBuffers(1, laser_points_vbo); 1649 1650 *laser_colors_vbo = 0; 1651 glGenBuffers(1, laser_colors_vbo); 1618 1652 } 1619 1653 … … 1626 1660 GLuint normals_vbo, 1627 1661 GLuint ubo, 1628 GLuint model_mat_idx_vbo) { 1662 GLuint model_mat_idx_vbo, 1663 GLuint laser_points_vbo, 1664 GLuint laser_colors_vbo) { 1629 1665 GLsizeiptr points_buffer_size = 0; 1630 1666 GLsizeiptr textures_buffer_size = 0; … … 1637 1673 vector<SceneObject>::iterator it; 1638 1674 1639 /* Find all shaders that need to be used and 1675 /* Find all shaders that need to be used and the number of objects and 1640 1676 * number of points for each shader. Construct a map from shader id to count 1641 1677 * of points being drawn using that shader (for thw model matrix ubo, we … … 1684 1720 shaderBufferInfo[shaderIt->first].vbo_base = lastShaderCount * 2; 1685 1721 shaderBufferInfo[shaderIt->first].ubo_base = lastShaderUboCount * 2; 1722 1723 if (shaderIt->first == 9) { // hack to check for laser_sp 1724 shaderBufferInfo[shaderIt->first].vbo_base = 0; 1725 shaderBufferInfo[shaderIt->first].ubo_base = 0; // unused now anyway 1726 } 1727 1686 1728 cout << "shader: " << shaderIt->first << endl; 1687 1729 cout << "point counts: " << shaderCounts[shaderIt->first] << endl; … … 1722 1764 glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo); 1723 1765 glBufferData(GL_ARRAY_BUFFER, model_mat_idx_buffer_size, NULL, GL_DYNAMIC_DRAW); 1766 1767 unsigned int max_num_lasers = 20; 1768 1769 glBindBuffer(GL_ARRAY_BUFFER, laser_points_vbo); 1770 glBufferData(GL_ARRAY_BUFFER, max_num_lasers * 18 * sizeof(GLfloat) * 3, NULL, GL_DYNAMIC_DRAW); 1771 1772 glBindBuffer(GL_ARRAY_BUFFER, laser_colors_vbo); 1773 glBufferData(GL_ARRAY_BUFFER, max_num_lasers * 18 * sizeof(GLfloat) * 3, NULL, GL_DYNAMIC_DRAW); 1724 1774 1725 1775 for (it = objects.begin(); it != objects.end(); it++) { … … 1731 1781 normals_vbo, 1732 1782 ubo, 1733 model_mat_idx_vbo); 1783 model_mat_idx_vbo, 1784 laser_points_vbo, 1785 laser_colors_vbo); 1734 1786 } 1735 1787 } … … 1743 1795 GLuint normals_vbo, 1744 1796 GLuint ubo, 1745 GLuint model_mat_idx_vbo) { 1797 GLuint model_mat_idx_vbo, 1798 GLuint laser_points_vbo, 1799 GLuint laser_colors_vbo) { 1746 1800 BufferInfo* bufferInfo = &shaderBufferInfo[obj.shader_program]; 1747 1801 … … 1749 1803 obj.ubo_offset = bufferInfo->ubo_base + bufferInfo->ubo_offset; 1750 1804 1751 glBindBuffer(GL_ARRAY_BUFFER, points_vbo); 1752 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.points.size() * sizeof(GLfloat), &obj.points[0]); 1753 1754 glBindBuffer(GL_ARRAY_BUFFER, colors_vbo); 1755 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.colors.size() * sizeof(GLfloat), &obj.colors[0]); 1756 1757 glBindBuffer(GL_ARRAY_BUFFER, selected_colors_vbo); 1758 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.selected_colors.size() * sizeof(GLfloat), &obj.selected_colors[0]); 1759 1760 glBindBuffer(GL_ARRAY_BUFFER, texcoords_vbo); 1761 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 2, obj.texcoords.size() * sizeof(GLfloat), &obj.texcoords[0]); 1762 1763 glBindBuffer(GL_ARRAY_BUFFER, normals_vbo); 1764 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.normals.size() * sizeof(GLfloat), &obj.normals[0]); 1765 1766 glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo); 1767 for (int i = 0; i < obj.num_points; i++) { 1768 glBufferSubData(GL_ARRAY_BUFFER, (obj.vertex_vbo_offset + i) * sizeof(GLuint), sizeof(GLuint), &obj.ubo_offset); 1769 } 1770 1771 obj.model_mat = obj.model_transform * obj.model_base; 1772 glBindBuffer(GL_UNIFORM_BUFFER, ubo); 1773 glBufferSubData(GL_UNIFORM_BUFFER, obj.ubo_offset * sizeof(mat4), sizeof(mat4), value_ptr(obj.model_mat)); 1805 if (obj.type == TYPE_LASER) { 1806 glBindBuffer(GL_ARRAY_BUFFER, laser_points_vbo); 1807 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.points.size() * sizeof(GLfloat), &obj.points[0]); 1808 1809 glBindBuffer(GL_ARRAY_BUFFER, laser_colors_vbo); 1810 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.points.size() * sizeof(GLfloat), &obj.colors[0]); 1811 } else { 1812 glBindBuffer(GL_ARRAY_BUFFER, points_vbo); 1813 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.points.size() * sizeof(GLfloat), &obj.points[0]); 1814 1815 glBindBuffer(GL_ARRAY_BUFFER, colors_vbo); 1816 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.colors.size() * sizeof(GLfloat), &obj.colors[0]); 1817 1818 glBindBuffer(GL_ARRAY_BUFFER, selected_colors_vbo); 1819 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.selected_colors.size() * sizeof(GLfloat), &obj.selected_colors[0]); 1820 1821 glBindBuffer(GL_ARRAY_BUFFER, texcoords_vbo); 1822 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 2, obj.texcoords.size() * sizeof(GLfloat), &obj.texcoords[0]); 1823 1824 glBindBuffer(GL_ARRAY_BUFFER, normals_vbo); 1825 glBufferSubData(GL_ARRAY_BUFFER, obj.vertex_vbo_offset * sizeof(GLfloat) * 3, obj.normals.size() * sizeof(GLfloat), &obj.normals[0]); 1826 1827 glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo); 1828 for (int i = 0; i < obj.num_points; i++) { 1829 glBufferSubData(GL_ARRAY_BUFFER, (obj.vertex_vbo_offset + i) * sizeof(GLuint), sizeof(GLuint), &obj.ubo_offset); 1830 } 1831 1832 obj.model_mat = obj.model_transform * obj.model_base; 1833 glBindBuffer(GL_UNIFORM_BUFFER, ubo); 1834 glBufferSubData(GL_UNIFORM_BUFFER, obj.ubo_offset * sizeof(mat4), sizeof(mat4), value_ptr(obj.model_mat)); 1835 } 1774 1836 1775 1837 bufferInfo->vbo_offset += obj.num_points; … … 1787 1849 } 1788 1850 1789 void renderScene( vector<SceneObject>& objects,1790 GLuint color_sp, GLuint texture_sp, 1791 GLuint vao1, GLuint vao2,1851 void renderScene(map<GLuint, BufferInfo>& shaderBufferInfo, 1852 GLuint color_sp, GLuint texture_sp, GLuint laser_sp, 1853 GLuint color_vao, GLuint texture_vao, GLuint laser_vao, 1792 1854 GLuint colors_vbo, GLuint selected_colors_vbo, 1793 SceneObject* selectedObject, 1794 map<GLuint, BufferInfo>& shaderBufferInfo) { 1855 SceneObject* selectedObject) { 1795 1856 1796 1857 glUseProgram(color_sp); 1797 glBindVertexArray( vao1);1858 glBindVertexArray(color_vao); 1798 1859 1799 1860 if (selectedObject != NULL) { … … 1810 1871 1811 1872 glUseProgram(texture_sp); 1812 glBindVertexArray( vao2);1873 glBindVertexArray(texture_vao); 1813 1874 1814 1875 glDrawArrays(GL_TRIANGLES, shaderBufferInfo[texture_sp].vbo_base, shaderBufferInfo[texture_sp].vbo_offset); 1815 } 1816 1817 void renderLasers(GLuint sp, GLuint vao, unsigned int numLasers) { 1818 glUseProgram(sp); 1819 glBindVertexArray(vao); 1820 1821 glDrawArrays(GL_TRIANGLES, 0, numLasers * 18); 1876 1877 glUseProgram(laser_sp); 1878 glBindVertexArray(laser_vao); 1879 1880 glDrawArrays(GL_TRIANGLES, shaderBufferInfo[laser_sp].vbo_base, shaderBufferInfo[laser_sp].vbo_offset); 1822 1881 } 1823 1882 … … 1921 1980 GLuint normals_vbo, 1922 1981 GLuint ubo, 1923 GLuint model_mat_idx_vbo) { 1982 GLuint model_mat_idx_vbo, 1983 GLuint laser_points_vbo, 1984 GLuint laser_colors_vbo) { 1924 1985 SceneObject obj = SceneObject(); 1986 obj.type = TYPE_ASTEROID; 1925 1987 obj.shader_program = shader; 1926 1988 … … 2039 2101 normals_vbo, 2040 2102 ubo, 2041 model_mat_idx_vbo); 2103 model_mat_idx_vbo, 2104 laser_points_vbo, 2105 laser_colors_vbo); 2042 2106 } 2043 2107
Note:
See TracChangeset
for help on using the changeset viewer.