[QUOTE=Darwin226;27618720]Aren't you supposed to use glOrtho or what ever it's called for non-3D stuff?[/QUOTE]
Yes but, it's just drawing polygons and I am going to be rendering 3D stuff. I've tried pre-transformed vertices and that didn't work.
I hope this API matter is solved as soon as possible. I don't want to throw code around because the whole authentication system changes. I'd rather just use a public API.
Lightmap. Thanks layla, your source code has been really useful :v:
[IMG]http://i54.tinypic.com/1z65t3t.png[/IMG]
-snip- i misread.
HiredK you're making some real progress there.
Wow, that actually looks pretty decent! You're making very good progress.
Fixed my std::string problem, lol changed from vc++ 2008 to 2010 :P
[IMG]http://i55.tinypic.com/245kq6f.png[/IMG]
My C# game engine's dynamic geometry is working! :downs:
[editline]23rd January 2011[/editline]
Why is declaring vectors in OpenTK so complicated?
[QUOTE=likesoursugar;27618273]I have som problem with std::string... When I call lenght() the function return a random number like 24353455. I'm doing this in a class function which is in a lib... I'm totally locked.[/QUOTE]
Try calling size()
[b]Edit:[/b]
Oops, didn't see your other post. I'm blind. :P
Next up, I need to figure out how to use textures in opengl. Any hints, HiredK?
snip
This is silly. You need .Net 4 to load projects? Anyway, I can't make it work, I've reinstalled .NET 4 many times now with no progress, what should I do?
[img]http://gyazo.com/801f4601e17343cc4b3da0cccc43651b.png[/img]
Fixed Fructose to allow for nested blocks (which only turned out to be a [url=https://github.com/charliesome/Fructose/commit/86cb48a2b982fd319d541d51e142dcc48eb63f71]three line change[/url].) So now this works:
[img]http://ahb.me/1zN5[/img]
And it runs at speeds comparable to Ruby :woop:
Anyone knows how to have a global key hook with Python under Linux, like what [url=http://sourceforge.net/apps/mediawiki/pyhook/index.php?title=Main_Page]PyHook[/url] offers under Windows?
[QUOTE=likesoursugar;27622142]This is silly. You need .Net 4 to load projects? Anyway, I can't make it work, I've reinstalled .NET 4 many times now with no progress, what should I do?
[img_thumb]http://gyazo.com/801f4601e17343cc4b3da0cccc43651b.png[/img_thumb][/QUOTE]
open up the project file, and change the target .net version
[QUOTE=pro ruby dev;27622254]Fixed Fructose to allow for nested blocks (which only turned out to be a [url=https://github.com/charliesome/Fructose/commit/86cb48a2b982fd319d541d51e142dcc48eb63f71]three line change[/url].) So now this works:
[img_thumb]http://ahb.me/1zN5[/img_thumb]
And it runs at speeds comparable to Ruby :woop:[/QUOTE]
Ruby => Fructose => PHP => PHC
Yes.
How do you do mouse control stuff? Like moving a camera around?
[quote=zenx2;27623492]how do you do mouse control stuff? Like moving a camera around?[/quote]
gl_modelview
[QUOTE=ZenX2;27623492]How do you do mouse control stuff? Like moving a camera around?[/QUOTE]
1. Get mouse position relative to center of screen.
2. Do stuff such as rotate camera based on values.
3. Set mouse position to center of screen.
Progress on my Android game. Its fundamentals are based off Pac-Man, but its totally physics based and I'm going to add powerups and such. The levels are going to be much larger, so the camera scrolls around with the player. I just finished adding a particle effect under the players feet as he moves around.
[img]http://i54.tinypic.com/166em3o.jpg[/img]
[QUOTE=ZenX2;27621348]Next up, I need to figure out how to use textures in opengl. Any hints, HiredK?[/QUOTE]
I'm using SDL_image for my texture loader, here's the source.
[B]TextureLoader.h[/B]
[code]#ifndef _TEXTURELOADER_H_
#define _TEXTURELOADER_H_
#include "Common.h"
class TextureLoader {
public:
static TextureLoader* getInstance();
unsigned int load(const char *textureFilename);
private:
static TextureLoader* instance;
TextureLoader();
~TextureLoader();
map<string,int> cache;
};
#endif[/code][B]TextureLoader.cpp[/B]
[code]#include "TextureLoader.h"
#include "Engine.h"
#include "FileManager.h"
TextureLoader::TextureLoader() {}
TextureLoader::~TextureLoader() {}
TextureLoader* TextureLoader::instance = NULL;
TextureLoader* TextureLoader::getInstance()
{
if(instance == NULL) instance = new TextureLoader();
return instance;
}
unsigned int TextureLoader::load(const char *textureFilename)
{
string stringFilename = string(textureFilename);
GLuint image = cache[stringFilename];
if (image != 0) return image;
size_t size;
char* buffer;
SDL_Surface* surface;
GLenum texture_format;
GLint nOfColors;
FileManager::dataFileOpenBuffer(stringFilename, &buffer, &size);
SDL_RWops* rw = SDL_RWFromMem(buffer, size);
if((surface = IMG_Load_RW(rw, 0)))
{
nOfColors = surface->format->BytesPerPixel;
if (nOfColors == 4)
{
if (surface->format->Rmask == 0x000000ff)
texture_format = GL_RGBA;
else
texture_format = GL_BGRA;
}
else if(nOfColors == 3)
{
if (surface->format->Rmask == 0x000000ff)
texture_format = GL_RGB;
else
texture_format = GL_BGR;
} else
{
printf("TextureLoader::load(): The image '%s' is not truecolor\n", stringFilename.c_str());
}
glGenTextures(1, &image);
glBindTexture(GL_TEXTURE_2D, image);
glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0, texture_format, GL_UNSIGNED_BYTE, surface->pixels);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if(GlExt::isAnisoFilteringSupported())
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, GlExt::maxAnisotropy());
cache[stringFilename] = image;
}
else
{
printf("TextureLoader::load(): IMG_Load_RW() Error '%s'\n", SDL_GetError());
return 0;
}
if (surface) SDL_FreeSurface( surface );
FileManager::dataFileCloseBuffer(buffer);
SDL_RWclose(rw);
return image;
}[/code]
[QUOTE=John.Lua;27615480]I'm using GWEN. Garry wrote it.[/QUOTE]
Someone's working on a forum-posting AI apparently.
So where would I call TextureLoader::load?
[editline]23rd January 2011[/editline]
Nevermind, I found exactly what I was looking for in the OpenTK examples :P
[QUOTE=ralle105;27624269]1. Get mouse position relative to center of screen.
2. Do stuff such as rotate camera based on values.
3. Set mouse position to center of screen.[/QUOTE]
If you're not making a fast-paced first person game, this is fine. Otherwise, you'd want to use raw mouse input. If you're using Windows, [url=http://msdn.microsoft.com/en-us/library/ms645536%28v=vs.85%29.aspx]this will help[/url]. Additionally, you'll want to use ClipCursor() to keep the mouse from leaving the window rather than re-centering it.
Raw mouse input has a few advantages:
-Input is given in relative coordinates
-Windows' (or other OS) cursor ballistics doesn't mess with the data
-Sub-pixel cursor movement still registers (see above)
-Input can be hooked rather than polled (In Windows, use the message WM_INPUT)
Just remember to remove the cursor clip when the window loses focus or the user enters a game menu. Only use the cursor clip when the player can aim.
[editline]23rd January 2011[/editline]
I noticed someone posted a border-removal program. I have an open source C++ program people may be interested in.
[url=http://eagle.undo.it:8083/project/?id=4&act=info][img]http://eagle.undo.it:8083/project/?id=4&act=img[/img][/url]
The "noborder" feature of it works like this:
Position the center of the window you want to "noborder" on the desired monitor. Press RWIN+ENTER. The currently active window will be resized to the appropriate monitor's resolution and so on.
The only problems I have with it is that the way it hooks the keyboard could be improved. Also, sleep mode sometimes breaks it. Any tips?
[QUOTE=Ortzinator;27624951]Someone's working on a forum-posting AI apparently.[/QUOTE]
That's actually not a bad idea...
brb markov chains
I got mouse control working, except everything rotates around the center of the screen. :saddowns:
I was messing around with words in Java today and made a [URL="http://tallcorporation.co.cc/projects/words"]random phrase generator[/URL].
It isn't complete yet because it lacks some word types and the word-relationship system isn't ready for use, but it's proven amusing to mess around with.
[code]quest for the adjective noun -> quest for the inquisitive lock[/code]
Anyone else going to be in the Global Game Jam?
Yay! I love the matrix stack but, my rectangles only render at 0, 0, 0. :frown:
[QUOTE=ZenX2;27626073]I got mouse control working, except everything rotates around the center of the screen. :saddowns:[/QUOTE]
Are you rotating before you translate?
Yes, is that backwards?
Sorry, you need to Log In to post a reply to this thread.