Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DarkNebula

Weird texture problem.

This topic is 5322 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m having this weird texture problem where the texture keeps flashing and turing upside down on my button :\ I''ve checked things and it seems it''s the cBMainMenu->Selection(GLMOUSE_M); line in the WM_MOUSEMOVE case. But no matter what I do and try to fix it while keeping that line in there, I can''t get it to work. Could anyone help me out? I''ve posted all my code here: http://home.comcast.net/~darknebula/Source.zip . Sorry if it is horrible coding or stupid looking, but I''m new to this so don''t flame me Any help would be great! Thanks in advanced. Oh yea, when I added the FreeType text that is commented out in my Game_Main the buttons work, but this isn''t really a fix for the problem by just including text to fix my buttons... :/ - DarkNebula

Share this post


Link to post
Share on other sites
Advertisement
Did you make a custom CURSOR and add it as a resource? Also sometimes you have to showCursor(FALSE); and showCursor(TRUE); to get the thing working right.

Share this post


Link to post
Share on other sites
If you implemented your own, then if you get the texture coordinates backward it could flip your image.

How did you implement your cursor?

Share this post


Link to post
Share on other sites
Here is what it should look like:

The cursor is over the top button but when I press "print screen" it disappears.

Here is what it looks like when I take the cursor's position text out of it:


It also switches really fast between different messed up views of the same texture.



- DarkNebula

EDIT: Tried to fix the images...

[edited by - DarkNebula on January 14, 2004 10:03:39 PM]

Share this post


Link to post
Share on other sites
Well at first glance, it looks like you have your texture coords fux0red up. It's really hard to say without seeing some relevant code.


EDIT: nm, I see the link in the first post. I'll have a look.

-=[ Megahertz ]=-

[edited by - Megahertz on January 16, 2004 10:52:02 AM]

Share this post


Link to post
Share on other sites
Ok, well, I looked at the code and for the most part was able to follow along with the general flow of things. However, once I started tracing through the GUI stuff I got completely lost and confused.

I certainly dont mean to be rude, but this has got to be the most ofuscated GUI code I''ve seen. =)

The thing that confuses me the most is why you would use OpenGL''s picking stuff for the GUI, especially the buttons when a simple is the x,y where the mouse was pressed inside the rect of the button. If you''re going to have alpha blended buttons, it might make some sense. Also, I see picking code when you set up the menu and the buttons. The only place there should be any picking code IMO would be in the method that handles the OnClick event or wherever the code that gets executed when the user presses the mouse button is. You''ve got picking code all over, but I guess it works. =)

In any event, I really couldnt find anything really wrong, but im sure something is foobar''d somewhere. I couldnt get it to compile as I dont have freetype installed, so I couldnt really debug it. I might try again later if its pretty easy to install and setup.

More comments in the code would prolly help too. =)


-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites
Ditto on the couldn''t compile it - unresolved externals like _FT_Get_Char_Index.

I''ll have a glance through your code, but unless I can get it to compile it''ll be almost impossible to debug.

If you''re using VC7, please, please, please find the option for scoping rules in for loops and make it standards-compliant. If you''re using VC6, then please don''t rely on non-compliant behaviour.

Example:
for (int i = 7; i < 10; i++)
{
// do something with i
}
i = 32; // non-conformant - i should only exist within the scope of the for loop

The correct code would be:
int i;
for (i = 7; i < 10; i++)
{
// do something with i
}
i = 32; // correct - now i exists outside the for loop


Enigma

Share this post


Link to post
Share on other sites
Sorry for the crappy code, but I''m still really new at this and I hope with experence, my code will get better, lol.

- DarkNebula

Share this post


Link to post
Share on other sites

  • 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!