• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

astronautusKobayus

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

100 Neutral

About astronautusKobayus

  • Rank
    Newbie
  1. [size=4]I started a small test program for Mac with Xcode 4.2 that aims to render a 3d Cube using OpenGL VBO. The fact is that all I get from running the application is a black screen.[/size] [size=4]What I am basically doing is creating a new Cocoa project with the default AppDelegate.m and AppDelegate.h inheriting from NSObject, I don't modify these files. Then in the MainMenu.xib I add an OPenGLView object from the Object libraries and specify in the attributes tab a class that I create to handle all the OpenGL stuff.[/size] [size=4]This class is MyOpenGLView (MyOpenGLView.h and MyOpenGLView.m). I attach those two files to a better understanding of what is happening.[/size] [size=4]What am I doing wrong?[/size] [size=4]MyOpenGLView.h[/size] [size=4] [code]// // MyOpenGLView.h // testOpenGl // // Created by astronautusKobayus on 3/7/12. //[/size] #import <Cocoa/Cocoa.h> GLfloat gCubeVertexData[] = { 0.3f, 0.3f, 0.3f, -0.3f, 0.3f, 0.3f , -0.3f, -0.3f, 0.3f , 0.3f, -0.3f, 0.3f , 0.3f, -0.3f, -0.3f , -0.3f, -0.3f, -0.3f , -0.3f, 0.3f, -0.3f , 0.3f, 0.3f, -0.3f }; // color array GLfloat colors[] = { 1,1,1, 1,1,0, 1,0,0, 1,0,1, // v0-v1-v2-v3 1,1,1, 1,0,1, 0,0,1, 0,1,1, // v0-v3-v4-v5 1,1,1, 0,1,1, 0,1,0, 1,1,0, // v0-v5-v6-v1 1,1,0, 0,1,0, 0,0,0, 1,0,0, // v1-v6-v7-v2 0,0,0, 0,0,1, 1,0,1, 1,0,0, // v7-v4-v3-v2 0,0,1, 0,0,0, 0,1,0, 0,1,1}; // v4-v7-v6-v5 // Define the vertex indices for the cube. GLuint g_Indices[24] = { 0, 1, 2, 3, // Front face 7, 4, 5, 6, // Back face 6, 5, 2, 1, // Left face 7, 0, 3, 4, // Right face 7, 6, 1, 0, // Top face 3, 2, 5, 4 // Bottom face }; @interface MyOpenGLView : NSOpenGLView { @public GLuint vertexBufferID; // vertex Buffer that holds sphere vertices array GLuint g_uiIndicesVBO; // indices buffer ID } - (void) drawAnObject; - (void) drawRect: (NSRect) bounds; - (void) setCubeVertices; @end[/code] MyOpenGLView.m [code]// // MyOpenGLView.m // testOpenGl // // Created by astronautusKobayus on 3/7/12. // #import "MyOpenGLView.h" #include <OpenGL/gl.h> @implementation MyOpenGLView -(void) setCubeVertices { glGenBuffers(1, &vertexBufferID); glGenBuffers( 1, &g_uiIndicesVBO ); // Copy the vertex data to the VBO glBindBuffer(GL_ARRAY_BUFFER_ARB, vertexBufferID); glBufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(gCubeVertexData), &gCubeVertexData); glBufferSubData(GL_ARRAY_BUFFER_ARB, sizeof(gCubeVertexData), sizeof(gCubeVertexData)+sizeof(colors), &colors); // Copy the index data to the VBO glBindBuffer( GL_ELEMENT_ARRAY_BUFFER_ARB, g_uiIndicesVBO ); glBufferData( GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(g_Indices), g_Indices, GL_STATIC_DRAW_ARB ); } -(void) drawAnObject { glColor3f(1.0f, 0.85f, 0.35f); // We need to enable the client stats for the vertex attributes we want // to render even if we are not using client-side vertex arrays. glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); // Bind the vertices's VBO glBindBufferARB( GL_ARRAY_BUFFER_ARB, vertexBufferID ); // before draw, specify vertex and index arrays with their offsets glVertexPointer(3, GL_FLOAT, 0, 0); glColorPointer(3, GL_FLOAT, 0, (void*)(sizeof(gCubeVertexData))); //after all vertices there are all colors // Bind the indices's VBO glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, g_uiIndicesVBO ); glDrawElements( GL_QUADS, 24, GL_INT, 0 ); // it is good idea to release VBOs with ID 0 after use. // Once bound with 0, all pointers in gl*Pointer() behave as real // pointer, so, normal vertex array operations are re-activated glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); glBindBuffer(GL_ARRAY_BUFFER_ARB, 0); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); // disable vertex arrays } -(void) drawRect: (NSRect) bounds { glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); [self setCubeVertices ]; [self drawAnObject]; glFlush(); } @end[/code]