🔒 Locked
Weird texture problem.
Advertisement
Original Post
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
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.
No I did not add a custom cursor.
- DarkNebula
- DarkNebula
If you implemented your own, then if you get the texture coordinates backward it could flip your image.
How did you implement your cursor?
How did you implement your cursor?
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]
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]
Anyone?
- DarkNebula
- DarkNebula
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 ]=-
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 ]=-
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:
The correct code would be:
Enigma
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
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
- DarkNebula
I have picking code in the mousemove part because it glows when you move the mouse over the button. (If that's what you were talking about.) lol
- DarkNebula
EDIT: (glows not glow)
[edited by - DarkNebula on January 16, 2004 3:07:02 PM]
- DarkNebula
EDIT: (glows not glow)
[edited by - DarkNebula on January 16, 2004 3:07:02 PM]
Here is the freetype libs, and includes that I''m using: http://home.comcast.net/~darknebula/FreeType.zip
- DarkNebula
- DarkNebula
*bump* :D
- DarkNebula
- DarkNebula
I guess since no one can get it I''ll just completly redo it.
- DarkNebula
- DarkNebula
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement