Jump to content
  • Advertisement

Kerkhoff

Member
  • Content Count

    72
  • Joined

  • Last visited

Everything posted by Kerkhoff

  1. Kerkhoff

    Another Demo

    here is the last version... http://members.gamedev.net/kerkhoff/JournalFiles/Predator-Demo.rar tell me what you thought...give me ideas... I'm a very bad layouter eauhuah this layout is very...very ugly I know...but Is the better(believe me) that I get.. Just copy and paste the font file to the c:\windows\fonts please ehehhe Thanx.... See ya
  2. Kerkhoff

    Link resolved....

    probably yes...but only after I release the first version =D until there..only demos.exe ehhehe thanx..
  3. the last link of the game was broked.. http://members.gamedev.net/kerkhoff/JournalFiles/Predator-Demo.exe okay =D byeee
  4. Hi... I'm having problems with glOrtho in fullscreen mode... here is my create window function void PDevice::BuildWindow(const LPCTSTR AWindowName, SRect* ADimension, PWindow* ANewWindow, bool AFullScreen) { DWORD WStyle; DWORD WExStyle; RECT ClientSize = {ADimension->Left(), ADimension->Top(), ADimension->Width() + ADimension->Left(), ADimension->Height() + ADimension->Top()}; int RealWidth = ClientSize.right - ClientSize.left; int RealHeight = ClientSize.bottom - ClientSize.top; int WindowLeft = (GetSystemMetrics(SM_CXSCREEN) - RealWidth) / 2; int WindowTop = (GetSystemMetrics(SM_CYSCREEN) - RealHeight) / 2; if (AFullScreen) { WExStyle = WS_EX_APPWINDOW; WStyle = WS_POPUP; ANewWindow->SetFullScreen(true); ANewWindow->SwitchToFullScreen(RealWidth, RealHeight); } else { WExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; WStyle = WS_OVERLAPPEDWINDOW; } AdjustWindowRectEx(&ClientSize, WStyle, false, WExStyle); SRect* NewBounds = new SRect(ADimension->Left(), ADimension->Top(), RealWidth, RealHeight); ANewWindow->SetBounds(NewBounds); try { ANewWindow->SetBorderWidth(ClientSize.left, ClientSize.top); ANewWindow->SetHandle(CreateWindowEx(WExStyle, AWindowName, AWindowName, WStyle, ADimension->Left(), ADimension->Top(), RealWidth + WindowLeft, RealHeight + WindowTop, NULL, NULL, GetModuleHandle(0), (void*)this)); PrepareWindowToDraw(ANewWindow); delete NewBounds; } catch(exception e) { delete NewBounds; throw e; } } my window show in fullscreen correctly...the mouse position in the right bottom of screen is 799, 599 (my windows setting is 1280x1024 and my app is running in 800x600) but the components on the screen gets crazy = (( here is my glResize function: void POpenGLDriver::ResizeDriver(SRect* ADimension) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, ADimension->Width(), ADimension->Height(), 0, 1, -1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } please...help me!!!! thanx
  5. Kerkhoff

    Fullscreen and glOrtho

    with pictures... right mode(windowed 800x600): wrong mode(fullScreen 800x600): and...glViewPort didn't work...it has no effect =( Thanx
  6. Kerkhoff

    Fullscreen and glOrtho

    I want to mean that if I draw the objects without fullscreen...creating a windows with 800x600 and apply the SetWindowPos function... my objects are drawed very nice...if I did not apply SetWindowPos, the window is created larger than 800x600 size = ( but...when I set the fullscreen mode, my objects are drawed out of my settings.... like the origin is another...or the size isn't right = ((( please...I need to resolve this.. thanx [Edited by - Kerkhoff on February 3, 2006 11:42:40 AM]
  7. Hi my friends... here is the new version of Predator Engine with some basic controls... download this file: http://members.gamedev.net/JournalFiles/Predator-Demo.exe Thanx... =D Next controls will be the check box, the check button, radio buttons, numeric updown, another panels... give me ideas..give me =D byeee
  8. Kerkhoff

    Fullscreen and glOrtho

    no no no...ehehe the gluOrtho2D is the equivalent of the glOrtho with the parameter (-1 and 1 in Z axys) that I have passed... and...the way that you call gluOrtho2D, has the same effect (upside down) of the Nairb suggestion eheh What can I do???? thanx
  9. Kerkhoff

    Fullscreen and glOrtho

    hehehe this really isn't work =P but I did like the effect =D Anyone have more suggestions? thanx...
  10. Kerkhoff

    Update....

    Just to keep you informed... I'm rewriting all the Predator Engine... =D There was very bugs and the code organization was going to the hell.. I'm writing carefully all components and after the primary controls be ready...I'll post the demo here... Firstly I would like to left done: PPanel, PButton (done) PLabel (done) PTextBox, PProgressBar with good features to have few work in get amazing effects... thanx...byeee
  11. Somebody has a good drawing technique? I run my program that is redraw everytime and my mem usage explode = ( if I draw the object only when it receives event...the mem usage increase with the amount of events that I fired. = ( like...each draw...1mb of memory = ( thanx
  12. Hi...check out my problem.. I have a X class that have this attribute: void (*FOnMouseClick)(PInputEventReceiver* ASender); and this method to set this attribute: void OnMouseClick(void (*AOnMouseClick)(PInputEventReceiver* ASender)); now...I have a Y class that have an object of type X and I need to set the attribute...so I declare private: void IncreaseButtonMouseClick(PInputEventReceiver* ASender); and in the constructor: FIncreaseButton->OnMouseClick(IncreaseButtonMouseClick); but I get this error: error C2664: 'Predator::Drawing::PInputEventReceiver::OnMouseClick' : cannot convert parameter 1 from 'void (Predator::Drawing::PInputEventReceiver *)' to 'void (__cdecl *)(Predator::Drawing::PInputEventReceiver *)' None of the functions with this name in scope match the target type if I write the function out of my class and set to the object of type X it works = ( what I have to do????? any suggestions?? thanx
  13. Kerkhoff

    Function pointer problem...

    forgive me please... I found my mistake... the ASender argument is the PButton and don't the PNumericUpDown = ( now..I'll see how can I workaround this problem... thanx <=)
  14. Kerkhoff

    Function pointer problem...

    Ok...thank god my events has the basic Sender argument.. but...I'm with another problem, when I cast my Sender to some object, I lost some data from the object.. like this.. void ButtonIncreaseMouseClick(PInputEventReceiver* ASender) { PNumericUpDown* MySelf = ((PNumericUpDown*)ASender); if (MySelf->GetValue() < MySelf->GetMaxValue()) MySelf->SetValue(MySelf->GetValue() + 1); } the MySelf->GetValue() returns a crazy number...but..the caption of buttons is right = ( what is happening? this is my constructor: PNumericUpDown::PNumericUpDown(SRect* ABounds, PGraphicObject* AParent, IVideoDriver* AVideoDriver):PInputEventReceiver(ABounds, AParent, AVideoDriver) { FEdit = new PTextBox(new SRect(ABounds->Left(), ABounds->Top(), (ABounds->Width() * 0.9), ABounds->Height()), ET_NUMERIC, AParent, AVideoDriver); FButtonIncrease = new PButton("+", new SRect(FEdit->GetBounds()->Width() + FEdit->GetBounds()->Left() + (ABounds->Width() * 0.025), ABounds->Top(), (ABounds->Width() * 0.075), (ABounds->Height() * 0.5)), RT_NORMAL, AParent, AVideoDriver); FButtonDecrease = new PButton("-", new SRect(FButtonIncrease->GetBounds()->Left(), FButtonIncrease->GetBounds()->Height() + FButtonIncrease->GetBounds()->Top(), FButtonIncrease->GetBounds()->Width(), (ABounds->Height() * 0.5)), RT_NORMAL, AParent, AVideoDriver); FEdit->SetReadOnly(true); GetChildReceivers()->Insert(FButtonIncrease); GetChildReceivers()->Insert(FButtonDecrease); GetChildReceivers()->Insert(FEdit); FValue = 0; FMinValue = 0; FMaxValue = 100; FButtonIncrease->OnMouseClick(ButtonIncreaseMouseClick); FButtonDecrease->OnMouseClick(ButtonDecreaseMouseClick); } thanx
  15. Kerkhoff

    Function pointer problem...

    Hi... firstly..thanx for the reply... after read the articles and some others... I conclude that C++ is very poor 'needy' in this way...the only workaround more elegant for my problem is this static void IncreaseButtonMouseClick(PInputEventReceiver* AObject, PInputEventReceiver* ASender); but, I CAN'T pass this function to my: void OnMouseClick(void (*AOnMouseClick)(PInputEventReceiver* ASender)); I'll not put the SomeClass pointer in my functions just to resolve this problem... how can I head off the 'this' parameter...obscure in the member functions? I have not found any good and elegant way... Thanx
  16. Ladies and gentlemans.. I present you.. the Predator Engine =P (clap clap clap clap) thanx...thanx =D Ok... Download it from this address and test what we got until now.. I made the follow components.. PLabel PPanel PButton PProgressBar no laughs please...I haven't much time = ( test and send me the bugs and new ideas for I implement it... Thanx a lot... to everyone
  17. Kerkhoff

    Let's play... = )

    but this is working = ( hehehe the only problem that I had is that the last message that was pushed on the queue is getting repeated until I send another message = ( for example...if I press a key, the keyup message is send until I move the mouse = ( but I fixed this bug... have find any other bug or have suggestions an how cai I improve the engine? thanx
  18. Hi my friends... After this late in post here... I bring some news... The PLabel class supports the Outline Fonts, Bitmap Fonts and Texture mapped fonts.. the PPanel class is almost done, it's working now, except by some details that I'll implement tomorrow, like caption align, borders visible, etc... the PGraphicObjectCollection is dead...it just brought me problems... PPanel : PInputEventReceiver private: PLabel* FCaption; SColor* FBackgroundColor; SColor* FBorderColor; std::string FTextureFileName; unsigned int FTexture; unsigned int FDisplayListRectWireFrame; unsigned int FDisplayListRect; unsigned int FDisplayListRectTexture; int FBorderWidth; int FRectType; bool FFilled; public: PPanel(SRect* ABounds, int ARectType, IVideoDriver* AVideoDriver); ~PPanel(void); PLabel* GetCaption(void); void SetCaption(PLabel* AValue); SColor* GetBackgroundColor(void); void SetBackgroundColor(SColor* AValue); SColor* GetBorderColor(void); void SetBorderColor(SColor* AValue); std::string GetTextureFileName(void); void SetTextureFileName(std::string AValue); int GetBorderWidth(void); void SetBorderWidth(int AValue); bool GetFilled(void); void SetFilled(bool AValue); void PrepareToDraw(void); void Draw(void); The IVideoDriver have some new methods too virtual AUX_RGBImageRec* LoadBMPRec(std::string AFileName) = 0; virtual void SetBlend(bool AValue) = 0; virtual void SetTexture(bool AValue) = 0; virtual unsigned int GenerateDisplayList(int AListSize) = 0; virtual void CallDisplayList(unsigned int ADisplayList) = 0; virtual void DestroyDisplayList(unsigned int ADisplayList, int ASize) = 0; virtual void LoadTexture(std::string AFileName, unsigned int &ATextureBuffer, int ATextureType) = 0; virtual void BindTexture(unsigned int ATextureBuffer) = 0; virtual void DrawText(std::string AText, float ASize, SColor* AColor, SCoord* ACoord, unsigned int ADisplayList, int AFontType) = 0; virtual unsigned int GenerateDisplayListRectWireFrame(SRect* ABounds, SColor* ABorderColor, int ABorderWidth) = 0; virtual unsigned int GenerateDisplayListRect(SRect* ABounds, SColor* ABackgroundColor) = 0; virtual unsigned int GenerateDisplayListRectTexture(SRect* ABounds, SColor* AColor) = 0; I'm using display list for everything, if someone has any suggestion in how I can approach the performance...tell me... I have made a little demo with two panels and one running label to show the use of layers and what we have until now: well...I hope you like the system... I think that our next step is make some buttons..right? see ya
  19. Hi, I'm having trouble with textures in opengl... I'm loading some texture files (.bmp) but the last file is used to all objects in the scene = (( here's my loadtexture code void POpenGLDriver::LoadTexture(std::string AFileName, unsigned int &ATextureBuffer, int ATextureType) { AUX_RGBImageRec *TextureImage = null; if (TextureImage = LoadBMPRec(AFileName)) { glGenTextures(1, &ATextureBuffer); glBindTexture(GL_TEXTURE_2D, ATextureBuffer); switch (ATextureType) { case TT_TEXT: { gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage->sizeX, TextureImage->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage->data); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); }break; case TT_RECT: { glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage->sizeX, TextureImage->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage->data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); }break; } } if (TextureImage) if (TextureImage->data) free(TextureImage->data); free(TextureImage); } any suggestion? Thanx...
  20. Kerkhoff

    Texture problem..

    one more doubt.. How can I repeat a texture inside a Rect??? currently, I'm stretching it... thanx
  21. Kerkhoff

    Texture problem..

    yeahhh!! thanx to everyone.. I just removed the glPushAttrib and it works great = D thanx a lot = D
  22. Kerkhoff

    Texture problem..

    = ((( first...thanx to everybody... I have tested my code in two video cards: Geforce fx5200 128mb Mobile intel 915GM/GMS (notebook =P) both doesn't work.. look my codes... where is my mistake??? this is the code that loads my texture and keep the ID into a varible ATextureBuffer void POpenGLDriver::LoadTexture(std::string AFileName, unsigned int &ATextureBuffer, int ATextureType) { AUX_RGBImageRec *TextureImage = null; if (TextureImage = LoadBMPRec(AFileName)) { glGenTextures(1, &ATextureBuffer); glBindTexture(GL_TEXTURE_2D, ATextureBuffer); switch (ATextureType) { case TT_TEXT: { gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage->sizeX, TextureImage->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage->data); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); }break; case TT_RECT: { glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage->sizeX, TextureImage->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage->data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); }break; } } if (TextureImage) if (TextureImage->data) free(TextureImage->data); free(TextureImage); } this code is call every time I draw the objects void POpenGLDriver::BindTexture(unsigned int ATextureBuffer) { glPushAttrib(GL_TEXTURE_BIT); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, ATextureBuffer); glPopAttrib(); } it doesn't work = (( my class have an unsigned int FTexture variable..that stores the TextureID, the texture ID is right when I debug this last method, but only the last texture file loaded matters = ( Help me please!!!!
  23. Kerkhoff

    Texture problem..

    Hi, thanx...but.. which methods of opengl I need to call everytime I draw the objects? if I call my LoadTexture method every time, it works.. but...I think that I don't need to load the bitmap everytime...right? so...which methods? thanx
  24. Kerkhoff

    Outline font bug??

    Hi, I have downloaded the lesson 14, with outline fonts, I changed the output text to some work with accents and like I thought, the GLYPHMETRICSFLOAT gets nuts... (test strin = "Test àçê?õá") = ( how can I workaround this problem?? and How can I get the text width if I use the gluOrtho2d? using the GLYPHMETRICSFLOAT, it give me the dimensions as the max coordinates being [-1, 1] Thanx!!
  25. Kerkhoff

    Outline font bug??

    but I rendered it using outline fonts in my engine just the GLYPHMETRICSFLOAT doesn't work... I'm using the GetTextExtent32 (I'm not sure that this is the right name) to do this job... thanx...
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!