Jump to content

  • Log In with Google      Sign In   
  • Create Account

Lazy Foo

Member Since 07 Sep 2004
Offline Last Active May 01 2015 10:11 PM

#5039625 HTML5 game development tools

Posted by on 05 March 2013 - 12:39 PM

   So I'm working on a new project that uses HTML5/JavaScript/Cocos2D. I've dabbled in Javascript before but I've never done anything large enough to warrant any tools more complex than notepad++.


   Now that I'm doing something real time, I am missing the features I had in IDEs like Visual Studio or even Code Blocks. Are there any tools that can:


-Check syntax so I know my my code will execute without having to refresh the page.

-Auto complete so I don't have to constantly flip back to the documentation to see what an an object's members are or what a function's arguments are.

-Multi-browser support so I can see what my code will run like multiple browsers without having to open multiple windows.

-Anything that make supporting internet explorer easier.


   I am on windows, but if there's anything on OSX or Linux I can work in those environments. Open Source or free is prefered but I may be able to actually purchase some software if it'll save me the time.

#4981581 Learning OpenGL

Posted by on 19 September 2012 - 01:32 AM

I made this OpenGL tutorial to teach the basics of rendering geometry, texturing and shaders with OpenGL 2.1/3.0. I recommend http://www.arcsynthesis.org/gltut/ as a follow up for the more advanced stuff.

#4980563 what should I do?

Posted by on 16 September 2012 - 12:26 AM

I made these game programming tutorials. You might find them helpful.

I recommend just dabbling in a bit of everything until you find something you like.

#4978832 beginner tutorials?

Posted by on 11 September 2012 - 03:08 AM

I recommend these although I may be biased.

#4976453 Scrolling in OpenGL

Posted by on 04 September 2012 - 09:55 AM

What you probably want to do is when the camera gets close to the edge of the room it should lock inside the room.

Also, as mentioned in the OpenGL scrolling tutorial, you shouldn't be using the projection matrix to scroll your camera.

#4975628 Kind of stuck in learning.

Posted by on 01 September 2012 - 09:43 PM

I mean it supports up to 2.1, but I don't want to waste time learning deprecated stuff. I made a snake game using SFML and OpenGL. Now I want to learn the new stuff, but unfortunately, my poor graphics card doesn't support it.

You can still learn a lot about OpenGL with a 2.1 implementation. If you haven't learned GLSL, you can still do quite a bit with with the 1.2 version that will be trivial to port to modern versions.

#4972534 ilutGLBindTexImage creates a 1*1 texture

Posted by on 23 August 2012 - 04:48 AM

I wasn't a fan of the DevIL/OpenGL built in loading functions. They were always buggy every time I used them.

The way I go about loading an OpenGL texture with DevIL is by creating a generic function that creates a texture from any pixel pointer and then just passing in the pixels from ilGetData().

#4972084 Game: Appstates and management

Posted by on 21 August 2012 - 11:56 PM

Hello Everyone,
I recently began upon programming my first serious game and I ran upon an SDL tutorial on appstates. The only issue is, I don't want to use SDL. Could anyone inform me on how to create appstates and an appstate manager? I just need it to do the basic stuff: Play an initial animation saying who the game was made by----> hand control over to the main menu------> hand control over to the game or credits --------> hand control to an in game menu.

I used the same GameState class I used for my SDL game as I did for my OpenGL iPhone app. The way I did it, there was no SDL or OpenGL code in the management of the game states, only in the implementation of the individual game states.

#4971714 GLEW not installing properly

Posted by on 20 August 2012 - 10:34 PM

No I put these few lines of code in and it seemed to work however I'm not really sure what they do. Can I link GLEW without them?

[source lang="cpp"]#pragma once#include <glew.h>#pragma comment(lib, "glew32.lib")#pragma comment(lib, "opengl32.lib")[/source]

It's basically a way of linking a library in code.

To do it from the IDE, you just add them in the additional dependencies field in your project properties.

#4971311 Text Won't Overlap 2D Quad

Posted by on 19 August 2012 - 09:10 PM

Have you tried changing this line:
glBlendFunc(GL_SRC_ALPHA,GL_ONE);   // Select The Type Of Blending


glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);   // Select The Type Of Blending

Because IIRC, the way you have it will make it so the color components add together. Since you're rendering on white, everything will be white because white = 1,1,1 and color values get truncated at 1.

Also, you seem to have a lot of extraneous state changes in your code. You should generally avoid making more state changes than you have to.

#4971039 Fragment output to specific color attachment? (SOLVED)

Posted by on 19 August 2012 - 02:36 AM

Thanks, it works! What about the new input system for vertex shaders? I know how to set the uniform variables, but how do I supply the vertex position and normal data? I use VBOs for my meshes, and they include the position, normal and UV coord. data, and I call the buffer data pointers before drawing the elements, but I don't know how to reach the data from the vertex shader... Posted Image

Using custom GLSL attributes. Where uniforms are variables used on all the vertex data, attributes are from each instance of the vertex data, All you have to do is 1) Define the variable in your vertex shader and fragment shader as you need them, 2) get the variable location in your OpenGL program using glGetAttribLocation() 3) Enable the attribute and set the data pointer.

#4970996 Fragment output to specific color attachment? (SOLVED)

Posted by on 18 August 2012 - 09:29 PM

gl_FragData[i] unless it has changed in GL 3.0/4.0

It has, you need to bind your fragment location before you link your program.

#4970648 glVertexPointer, glNormalPointer, and glTexCoordPointer deprecated? Correct use?

Posted by on 17 August 2012 - 01:28 PM

glVertexPointer, glNormalPointer, and glTexCoordPointer don't even exist in modern OpenGL as is all the fixed pipeline. Everything is shader based now.

When shaders and custom attributes came along they realized that vertex positions, normals, texture coordinates, etc were all just vectors. Rather than put in attributes that the programmer may or may not use, they just let you define what you needed with custom vertex attributes.

I have an OpenGL tutorial series designed to help people transition from the old fixed function pipeline to modern OpenGL. All you really need to know since you know shaders is that there aren't those built in attributes anymore and you have to make them again yourself. It's pretty each for the most part.

If you want to have a fixed function fallback, you can create pseudo shader. I have a shader class architecture where ShaderProgram is the base for PlainPolygonProgram. I then have a set of classes like PlainPolygonProgram21 PlainPolygonProgram30 PlainPolygonProgram15 PlainPolygonProgram11 that inherit from PlainPolygonProgram and support OpenGL version 2.1, 3.0, 1.5, and 1.1 respectively. On the outside the all work the same but the internals of which GLSL version is used and how the vertex data is sent changes depending on what the version supports.

#4970490 How Could I Learn OpenGL ES 3.0?

Posted by on 17 August 2012 - 03:46 AM

Why would I learn ES 2 when I can just learn the fully PC-compatible ES 3

Because what matters are the underlying concepts. The core graphics concepts of sending geometry and creating shaders to process the geometry data probably hasn't changed much.

A common newbie mistake is hearing that professionals are using a Shiny Tool and think that if they use the Shiny Tool that it will make them like professional in a meaningful way. It won't. What you need to do as a new programmer is make sure you grasp the foundational concepts of graphics programming and can apply them in a well structured and scalable way.

#4969043 OpenGL + SDL

Posted by on 13 August 2012 - 07:01 AM

If you want pixel perfect rendering, just remember that when polygons rasterize they rasterize to the center of the pixel. If you wanted to draw a line from 0 to 5 inclusive, you draw from 0.5 to 5.5.

Try setting up your ortho projection matrix and then translate it <0.5, 0.5, 0.0> to center your pixels.