[QUOTE=neos300;28569226]I tried to make my own, failed.
The callbacks to the entity are there because I have a global collision manager and it simply calls the onCollision method on every object that is being collided.
Also that other solution didn't work.[/QUOTE]
Thats because you're applying it wrong.
[QUOTE=DevBug;28569247]Thats because you're applying it wrong.[/QUOTE]
Your solution didn't work either.
What is the collidingy > y for anyway?
Is there a simple physics engine for android?
[QUOTE=Dj-J3;28569082]Learning directx, it's a fucking brainfuck so far. :byodood:
I'm not sure if i'm just stupid or if it's something that just suddenly makes sense. I understood it perfectly well up until the chapter about making a triangle. :v:
[img_thumb]http://img34.imageshack.us/img34/417/dattitle20110312224313.png[/img_thumb][/QUOTE]
Creation of a forward compatible OpenGL context is even more fun.
[code]void OpenGL::CreateContext()
{
// Create window
WNDCLASSEX wc;
ZeroMemory( &wc, sizeof( wc ) );
wc.cbSize = sizeof( wc );
wc.lpfnWndProc = _eventHandler;
wc.hInstance = GetModuleHandle( NULL );
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hIconSm = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.lpszClassName = "OpenGL 3.3";
if ( !RegisterClassEx( &wc ) ) Error( "Failed to register window class!" );
if ( !( _window = CreateWindowEx( WS_EX_CLIENTEDGE, "OpenGL 3.3", "OpenGL 3.3", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, GetModuleHandle( NULL ), NULL ) ) )
Error( "Failed to create the window!" );
if ( !( _hdc = GetDC( _window ) ) ) Error( "Failed to retrieve device context!" );
// Choose pixel format
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory( &pfd, sizeof( pfd ) );
pfd.nSize = sizeof( pfd );
pfd.nVersion = 1;
pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 32;
pfd.cDepthBits = 32;
pfd.iLayerType = PFD_MAIN_PLANE;
if ( !( pixelFormat = ChoosePixelFormat( _hdc, &pfd ) ) ) Error( "Failed to find suitable pixel format!" );
if ( !SetPixelFormat( _hdc, pixelFormat, &pfd ) ) Error( "Failed to set pixel format!" );
// Create temporary context and make sure we have support
HGLRC tempContext = wglCreateContext( _hdc );
if ( !tempContext ) Error( "Failed to create temporary context!" );
if ( !wglMakeCurrent( _hdc, tempContext ) ) Error( "Failed to activate temporary context!" );
int major, minor; glGetIntegerv( GL_MAJOR_VERSION, &major ); glGetIntegerv( GL_MINOR_VERSION, &minor );
if ( major < 3 || minor < 2 ) Error( "OpenGL 3.2 is not supported!" );
// Create forward compatible context
int attribs[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, major,
WGL_CONTEXT_MINOR_VERSION_ARB, minor,
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
PFNWGLCREATEBUFFERREGIONARBPROC wglCreateContextAttribsARB = (PFNWGLCREATEBUFFERREGIONARBPROC)wglGetProcAddress( "wglCreateContextAttribsARB" );
if ( !wglCreateContextAttribsARB ) Error( "Failed to find pointer to wglCreateContextAttribsARB function!" );
if ( !( _context = wglCreateContextAttribsARB( _hdc, 0, (UINT)attribs ) ) ) Error( "Failed to create forward compatible context!" );
// Remove temporary context and activate forward compatible context
wglMakeCurrent( NULL, NULL );
wglDeleteContext( tempContext );
if ( !wglMakeCurrent( _hdc, (HGLRC)_context ) ) Error( "Failed to activate forward compatible context!" );
// Show window
ShowWindow( _window, SW_SHOW );
UpdateWindow( _window );
}[/code]
For my tutorial, should I use libraries like GLM (math) and GLEE or should I show how to do everything yourself?
[QUOTE=Jacko2007;28570201]Is there a simple physics engine for android?[/QUOTE]
If its for a non commercial app then try this
[url]http://www.emini.at/index.php?option=com_content&view=article&id=23:emini-products&catid=16&Itemid=2[/url]
[QUOTE=BlkDucky;28567272]Surely doing it this way limits the number of tiles you can have to 10?[/QUOTE]
More like 127, considering there is the [0-9], [a-z], [A-Z], and all the fun characters like ~!@#$%^&*()_+=-`<>?,./;':"[] {}\t
Stop thinking in base 10 :v:
[QUOTE=neos300;28569369]Your solution didn't work either.
What is the collidingy > y for anyway?[/QUOTE]
Obviously logic flies over your head.
[QUOTE=Chandler;28570419]More like 127, considering there is the [0-9], [a-z], [A-Z], and all the fun characters like ~!@#$%^&*()_+=-`<>?,./;':"[] {}\t
Stop thinking in base 10 :v:[/QUOTE]
Ah. That would be true but:
[QUOTE=aero1444;28563938]Trying to make a tile based game (think the way pokemon works when you're not in battle). Got the map loading to work (it loads grids of integers from text files)[/QUOTE]
Integers.
[QUOTE=Richy19;28570777]I have one set up like this[/QUOTE]
This is how I do it. But I tend to have it formatted as 01, 02 etc. so it lines up properly with double digits.
Edit: @Xera: Can't unsee. :frown:
Goatse blocks?
[QUOTE=Overv;28570207]Creation of a forward compatible OpenGL context is even more fun.[/QUOTE]
I wonder how i'm gonna manage to remember the code and understand it enough to make my own stuff :ohdear:
[QUOTE=Overv;28570207]For my tutorial, should I use libraries like GLM (math) and GLEE or should I show how to do everything yourself?[/QUOTE]
Use them in the beginning and then elaborate on them later on.
I had some sort of a Codeblock the past few days. It was because I had no Idea what to do with my game. And some bugs I weren't aware of( and now am.) The weirdest of them being the one I posted some pages ago. The solution was quite easy. In C# variables are references. I did this:
[csharp]_vertices = _localVertices = _lineVerts = _localLineVerts = new VertexPositionColor[31557];[/csharp]
So when I modified _vertices I also modified _localVertices, etc...
So yeah I finally made my mind up about what I want to do. It will be a physics based puzzle. I can't say that much now, I still have to draw it on paper.
One of my test exe's is kind of fun to play with.(It can get laggy at around 250 objects, it depends on your specs I guess. [url=http://dl.dropbox.com/u/17769468/Debug.rar]Get it here in case you want it.[/url] you need the C# debug dll's.) Controls: Left Click = Spawn 5 triangles, Right Click = Create an Explosion(quadratic falloff) use the directional keys to move the camera(might want to spawn some triangles first to see the world limits.)
How does this look for an icon?
[img] http://filesmelt.com/dl/image-sunset.png[/img]
[img]http://gyazo.com/9a6fded6f4365479e3fd743d6ee85cbf.png[/img]
Any suggestions for a new one?
[QUOTE=Overv;28570207]Creation of a forward compatible OpenGL context is even more fun.
[code]void OpenGL::CreateContext()
{
// Create window
WNDCLASSEX wc;
ZeroMemory( &wc, sizeof( wc ) );
wc.cbSize = sizeof( wc );
wc.lpfnWndProc = _eventHandler;
wc.hInstance = GetModuleHandle( NULL );
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hIconSm = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.lpszClassName = "OpenGL 3.3";
if ( !RegisterClassEx( &wc ) ) Error( "Failed to register window class!" );
if ( !( _window = CreateWindowEx( WS_EX_CLIENTEDGE, "OpenGL 3.3", "OpenGL 3.3", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, GetModuleHandle( NULL ), NULL ) ) )
Error( "Failed to create the window!" );
if ( !( _hdc = GetDC( _window ) ) ) Error( "Failed to retrieve device context!" );
// Choose pixel format
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory( &pfd, sizeof( pfd ) );
pfd.nSize = sizeof( pfd );
pfd.nVersion = 1;
pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 32;
pfd.cDepthBits = 32;
pfd.iLayerType = PFD_MAIN_PLANE;
if ( !( pixelFormat = ChoosePixelFormat( _hdc, &pfd ) ) ) Error( "Failed to find suitable pixel format!" );
if ( !SetPixelFormat( _hdc, pixelFormat, &pfd ) ) Error( "Failed to set pixel format!" );
// Create temporary context and make sure we have support
HGLRC tempContext = wglCreateContext( _hdc );
if ( !tempContext ) Error( "Failed to create temporary context!" );
if ( !wglMakeCurrent( _hdc, tempContext ) ) Error( "Failed to activate temporary context!" );
int major, minor; glGetIntegerv( GL_MAJOR_VERSION, &major ); glGetIntegerv( GL_MINOR_VERSION, &minor );
if ( major < 3 || minor < 2 ) Error( "OpenGL 3.2 is not supported!" );
// Create forward compatible context
int attribs[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, major,
WGL_CONTEXT_MINOR_VERSION_ARB, minor,
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
PFNWGLCREATEBUFFERREGIONARBPROC wglCreateContextAttribsARB = (PFNWGLCREATEBUFFERREGIONARBPROC)wglGetProcAddress( "wglCreateContextAttribsARB" );
if ( !wglCreateContextAttribsARB ) Error( "Failed to find pointer to wglCreateContextAttribsARB function!" );
if ( !( _context = wglCreateContextAttribsARB( _hdc, 0, (UINT)attribs ) ) ) Error( "Failed to create forward compatible context!" );
// Remove temporary context and activate forward compatible context
wglMakeCurrent( NULL, NULL );
wglDeleteContext( tempContext );
if ( !wglMakeCurrent( _hdc, (HGLRC)_context ) ) Error( "Failed to activate forward compatible context!" );
// Show window
ShowWindow( _window, SW_SHOW );
UpdateWindow( _window );
}[/code]
For my tutorial, should I use libraries like GLM (math) and GLEE or should I show how to do everything yourself?[/QUOTE]
I'm gonna be using your tutorial with SFML.Net and WebGL, so I'd rather you used vanilla OGL.
[QUOTE=Xeon06;28571534]I'm gonna be using your tutorial with SFML.Net and WebGL, so I'd rather you used vanilla OGL.[/QUOTE]
GLEE is needed for extension loading (not needed with OpenTK or Tao) and GLM is for matrix and vector math (also included with OpenTK).
[QUOTE=Overv;28571586]GLEE is needed for extension loading (not needed with OpenTK or Tao) and GLM is for matrix and vector math (also included with OpenTK).[/QUOTE]
What about WebGL :(<
Edit: Found that [url]http://code.google.com/p/webgl-bench/source/browse/trunk/appengine/static/glmath.js?spec=svn8&r=8[/url]
[QUOTE=Quark:;28568334]So as long as there are equal rows to columns and equal digits in each row it'll load?[/QUOTE]
Well of course the tiles with each ID need to exist in the game to be rendered/work properly, but I see no reason why not - it just parses the integer values from the file and slaps them in a 2D array.
And the rows/columns can be different sizes - i.e. there can be 12 rows with 6 values each but all rows must be 6 across and there must be 12 full rows.
tl;dr a rectangle.
[editline]13th March 2011[/editline]
[QUOTE=BlkDucky;28570722]Integers.[/QUOTE]
to me it makes more sense to do it this way, even though I'll never need 2,147,483,647 tiles. Would it be better to use byte? The tileset is 256x256 with 16x16 tiles, i.e. 256 tiles. (but depending on what I do it'll probably expand)
[QUOTE=Richy19;28570777]I have one set up like this [quote]I have one set up like this
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 5 6 6 6 6 6 7 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 5 6 6 6 6 6 7 0 0 0
0 0 10 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 0 3 0 0 0
0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0
0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 5 6 6 7 0 0
0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 4 0 0 0 0
0 5 6 7 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 4 0 0 0 0
0 0 4 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 4 0 0 0 0
0 0 4 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 4 0 4 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[/quote][/QUOTE]
Yeah that's how mine works too, you could have any values you want, it's just that I've only added tiles for 0 and 1.
[QUOTE=BlkDucky;28570815]This is how I do it. But I tend to have it formatted as 01, 02 etc. so it lines up properly with double digits.
Edit: @Xera: Can't unsee. :frown:[/QUOTE]
This was the plan but it was only a test map with single digits so I got lazy.
[QUOTE=Xeon06;28571633]What about WebGL :(<
Edit: Found that [url]http://code.google.com/p/webgl-bench/source/browse/trunk/appengine/static/glmath.js?spec=svn8&r=8[/url][/QUOTE]
Yeah, that's all you need. WebGL is based on OpenGL ES 2.0, so you don't need any extension loading stuff.
[i]Accidentally edited your post instead of replying[/i] :ninja:
Turns out the MaxRects algorithm also works well for packing text glyphs.
[img]http://oi51.tinypic.com/9l94s7.jpg[/img]
I still always wonder why Unicode has all these random pictures stuffed in it.
[QUOTE=killman;28572005]Turns out the MaxRects algorithm also works well for packing text glyphs.
[img_thumb]http://oi51.tinypic.com/9l94s7.jpg[/img_thumb]
I still always wonder why Unicode has all these random pictures stuffed in it.[/QUOTE]
Zodiac signs aren't all that random. In addition to that there's other astrological and astronomical signs, warning signs, religious and other similar symbols (sickle and hammer on the right), chess pieces and card suits among other things; These can actually be useful.
[QUOTE=Overv;28570207][code]
if ( major < 3 || minor < 2 )
[/code][/QUOTE]
Should be:
[code]
if ( major < 3 || ( major == 3 && minor < 2 ) )
[/code]
Otherwise it won't work with (for example) 4.1 since minor is less than 2.
[QUOTE=Overv;28570207]Creation of a forward compatible OpenGL context is even more fun.
For my tutorial, should I use libraries like GLM (math) and GLEE or should I show how to do everything yourself?[/QUOTE]
What will be the required openGL verssion for your tutorials?
Also how can i find out what openGL version i have in linux?
[QUOTE=Richy19;28572840]What will be the required openGL verssion for your tutorials?
Also how can i find out what openGL version i have in linux?[/QUOTE]
3.1 and [i]glxinfo[/i] should do.
[QUOTE=Overv;28572969]3.1 and [i]glxinfo[/i] should do.[/QUOTE]
Damn, looks like i wont be able to follow your tutorials :(
[quote]
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20100330 DEVELOPMENT x86/MMX/SSE2
OpenGL version string: 2.1 Mesa 7.9-devel
OpenGL shading language version string: 1.20
[/quote]
[QUOTE=Richy19;28573015]Damn, looks like i wont be able to follow your tutorials :([/QUOTE]
You'll need geforce 8000+, for ati, no idea.
oh, you're using a laptop, I can't run my own 3.1 apps on my laptop neither "/
[QUOTE=DevBug;28572899][cpp]
void Game::Render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.f, 0.f, -200.f);
glRotatef(m_Clock.GetElapsedTime() * 50.0f, 1.0f, 1.0f, 1.0f);
m_Terrain->Bind();
m_CubeVBO->Bind(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, 0);
m_CubeTexVBO->Bind(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, 0);
glDrawArrays(GL_QUADS, 0, 4 * 6);
m_CubeVBO->Unbind(GL_VERTEX_ARRAY);
m_CubeTexVBO->Unbind(GL_TEXTURE_COORD_ARRAY);
m_Window.Display();
}
[/cpp]
[img_thumb]http://anyhub.net/file/27ei-vbo.gif[/img_thumb]
I'll create a matrix class later, and stop using quads.[/QUOTE]
Why don't you switch to using shaders?
You get more flexibility that way than the standard fixed pipeline.
[QUOTE=BlkDucky;28570722]Ah. That would be true but: Integers.[/QUOTE]
In C (and C++) character literals are integers :smugdog:
[cpp]
#include <stdio.h>
int main(void) {
printf("The letter A is also the number: %i\n", 'A');
return 0;
}
[/cpp]
[code]The letter A is also the number: 65[/code]
What you know about ASCII!? :kraken:
[b]Edit:[/b]
Additionally, storing it as a text file might be worse, and a byte system in a binary file would be beneficial allowing 255 (everything minus a null character) types of tiles to be stored. The only issue then would be storing the number of rows and columns, but that could be placed into a header. :)
Sorry, you need to Log In to post a reply to this thread.