[QUOTE=KatNotDinner;44885028]Thanks a lot, I feel really stupid now. But there's another problem. It still reports error 1280, but after tht the triangle appears. Any ideas what enumeration could be wrong?[/QUOTE]
spam glGetError and find the line that's causing it, use something like [url]https://www.opengl.org/wiki/Debugging_Tools#GLIntercept[/url] to read all of the calls to opengl (including glGetError) and in the intercept log it will convert the number returned back to the name of the enumeration, this is really useful in reading all of the error codes.
I have an OpenGL question:
this code doesn't work, it leaves the color black:
[code]glColor3f(0.0f, 0.0f, 1.0f);[/code]
this works, it turns the color red, green and yellow
[code]glColor3f(1.0f, 0.0f, 0.0f);
glColor3f(0.0f, 1.0f, 0.0f);
glColor3f(1.0f, 1.0f, 0.0f);[/code]
[QUOTE=Pat.Lithium;44886393]I have an OpenGL question:
this code doesn't work, it leaves the color black:
[code]glColor3f(0.0f, 0.0f, 1.0f);[/code]
this works, it turns the color red, green and yellow
[code]glColor3f(1.0f, 0.0f, 0.0f);
glColor3f(0.0f, 1.0f, 0.0f);
glColor3f(1.0f, 1.0f, 0.0f);[/code][/QUOTE]
Make sure your shaders/program is called correctly. I had a similar issue when I forgot to call glUseShader().
[QUOTE=rookwood101;44885447]spam glGetError and find the line that's causing it, use something like [url]https://www.opengl.org/wiki/Debugging_Tools#GLIntercept[/url] to read all of the calls to opengl (including glGetError) and in the intercept log it will convert the number returned back to the name of the enumeration, this is really useful in reading all of the error codes.[/QUOTE]
Thanks a lot for the advice, will certainly try it out when I'm home.
[QUOTE=reevezy67;44886409]Make sure your shaders/program is called correctly. I had a similar issue when I forgot to call glUseShader().[/QUOTE]
glUseShader is undefined
I've been trying to make a cheat for PCSX2 Tokyo Xtreme Racer 3 using Cheat Engine. I want the cheat to give the player maximum money but the scan did not find the current value of the money I have now (115,240CP). I know it's an exact value and it should be in 4 bytes as it is too large for 2 bytes and 8 bytes seems excessive since PCSX2 doesn't use it most of the time.
The template for PCSX2 cheats is like this:
[QUOTE]gametitle=(name here)
comment=(something that shows up in the console)
patch=1,EE,address,(byte/short/word),value[/QUOTE]
This is based on the last 3 words on this table:
[img]http://i.imgur.com/OzKpVkt.png[/img]
byte = 0-255 (byte)
2 bytes = 0-65535 (short)
4 bytes = 0-4294967295 (word)
[QUOTE] address: the location of the cheat
type: should be left alone
value: self explanitory[/QUOTE]
Screencap (This was taken after the initial scan):
[t]http://i.imgur.com/A3C9WY6.png[/t]
As you can see, my current amount of CP is 115240. When I typed that in the value box, it is not detected.
I must be doing something wrong here as the address doesn't shows up in the box on the left. What am I doing wrongly?
[QUOTE=iAmaNewb;44893181]I've been trying to make a cheat for PCSX2 Tokyo Xtreme Racer 3 using Cheat Engine. I want the cheat to give the player maximum money but the scan did not find the current value of the money I have now (115,240CP). I know it's an exact value and it should be in 4 bytes as it is too large for 2 bytes and 8 bytes seems excessive since PCSX2 doesn't use it most of the time.
The template for PCSX2 cheats is like this:
This is based on the last 3 words on this table:
[img]http://i.imgur.com/OzKpVkt.png[/img]
byte = 0-255 (byte)
2 bytes = 0-65535 (short)
4 bytes = 0-4294967295 (word)
Screencap (This was taken after the initial scan):
[t]http://i.imgur.com/A3C9WY6.png[/t]
As you can see, my current amount of CP is 115240. When I typed that in the value box, it is not detected.
I must be doing something wrong here as the address doesn't shows up in the box on the left. What am I doing wrongly?[/QUOTE]
Since it's a value that's likely only modified with addition and subtraction, and it's a monetary value (so it's always displayed in decimal and operated in decimal), maybe it's also stored in decimal?
In such a case you'd probably be looking for an arbitrarily long byte array with the data in decimal. The byte order is anyone's guess.
[QUOTE=ThePuska;44893841]Since it's a value that's likely only modified with addition and subtraction, and it's a monetary value (so it's always displayed in decimal and operated in decimal), maybe it's also stored in decimal?
In such a case you'd probably be looking for an arbitrarily long byte array with the data in decimal. The byte order is anyone's guess.[/QUOTE]
I don't think it's stored in decimals, the comma is just to make it easier to see it's in the hundred thousands.
Ok, hit a rock again. My OpenGL program now opens up and shows a black triangle. The problem is that I have a buffer that stores colors but for whatever reason isn't being used.
If I manually set the color to (1, 0, 0, 1) in the shader I get a red triangle, but when I tell it to use the colors assigned by the program, the shape drawn is black. Any ideas what could be wrong?
[url]http://pastebin.com/Vpx7xGzZ[/url]
The link is the same, just updated with the new code.
Need some Java help here. What I'm trying to do is call a number of methods that modify an array, and then check if they actually modified it or if it stayed the same.
My issue: I store a copy of the original boolean array to an empty one, go through all the methods, then check if they are the same at the end. The problem is that when I run these methods, the copy array seems to be modified with the original one. How can I prevent this?
[code] public void prepare(int dir){
check czech = new check();
again = false;
do {
copy = logic;
System.out.println("Copy: " + Arrays.toString(copy));
System.out.println("Logic: " + Arrays.toString(logic));
// I know that calling the method by itself will automatically update the logic array, however, I did logic = next to every method to see if it would prevent the modification of the copy array, but to no avail.
logic = czech.c0(logic, dir, 0);
logic = czech.c1(logic, dir, 1);
logic = czech.c2(logic, dir, 2);
logic = czech.c3(logic, dir, 3);
logic = czech.c4(logic, dir, 4);
logic = czech.c5(logic, dir, 5);
logic = czech.c6(logic, dir, 6);
logic = czech.c7(logic, dir, 7);
logic = czech.c8(logic, dir, 8);
logic = czech.c9(logic, dir, 9);
logic = czech.c10(logic, dir, 10);
logic = czech.c11(logic, dir, 11);
logic = czech.c12(logic, dir, 12);
logic = czech.c13(logic, dir, 13);
logic = czech.c14(logic, dir, 14);
logic = czech.c15(logic, dir, 15);
System.out.println("Copy: " + Arrays.toString(copy));
System.out.println("Logic: " + Arrays.toString(logic));
if (copy != logic) again = true;
} while(again);
repaint();
}[/code]
Output:
[code]Copy: [false, false, false, false, false, false, false, true, false, false, false, false, false, true, false, false]
Logic: [false, false, false, false, false, false, false, true, false, false, false, false, false, true, false, false]
Copy: [false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, false]
Logic: [false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, false][/code]
The copy array automatically updates with the logic array for whatever reason.
If there is a better way to check if an array has been modified, please suggest it.
Weird, in C# there is Enum.HasFlag(Flag) which checks if the enum contains a Flag.
This is my Enum:
[code]
public enum TypeFace
{
ITALIC,
BOLD,
NONE
}
[/code]
If i do this:
[code]
TypeFace face = TypeFace.NONE;
Boolean test = face.HasFlag(TypeFace.ITALIC);
[/code]
test is true, someone knows why? TypeFace.NONE doesnt contain TypeFace.ITALIC...
Random question, is it possible to read Valve's demo files' playerstats?
[QUOTE=johnnyaka;44897654]Weird, in C# there is Enum.HasFlag(Flag) which checks if the enum contains a Flag.
This is my Enum:
[code]
public enum TypeFace
{
ITALIC,
BOLD,
NONE
}
[/code]
If i do this:
[code]
TypeFace face = TypeFace.NONE;
Boolean test = face.HasFlag(TypeFace.ITALIC);
[/code]
test is true, someone knows why? TypeFace.NONE doesnt contain TypeFace.ITALIC...[/QUOTE]
Enums are numbered sequentially by default. You have to manually number them if you want to use them as flags(bit flags).
For example:
[code] public enum TypeFace
{
ITALIC = 1,
BOLD = 2,
OTHER = 4
NONE = 0
}[/code]
Here are the values of the original enum without numbering manually.
[thumb]http://i.imgur.com/v05Tg11.png[/thumb]
[QUOTE=johnnyaka;44897654]Weird, in C# there is Enum.HasFlag(Flag) which checks if the enum contains a Flag.
This is my Enum:
[code]
public enum TypeFace
{
ITALIC,
BOLD,
NONE
}
[/code]
If i do this:
[code]
TypeFace face = TypeFace.NONE;
Boolean test = face.HasFlag(TypeFace.ITALIC);
[/code]
test is true, someone knows why? TypeFace.NONE doesnt contain TypeFace.ITALIC...[/QUOTE]
[url=http://stackoverflow.com/a/8480/2104717]This Stack Overflow[/url] answer should help you. TL;DR: Values in enums aren't automatically powers of two, but if you want to use them as flags, they have to be. You need to write this to make it work:
[code]
public enum TypeFace
{
ITALIC = 1,
BOLD = 2,
NONE = 4
}
[/code]
I'd also suggest leaving out "NONE" as a flag. It doesn't make much sense here, as it's implied when no other flag is set. If you wanna read more about bit fields, which are what you're trying to implement, then take a look at [url=http://dotnet.dzone.com/articles/using-bit-fields-c]this article[/url].
I'm having a bit of a problem with game timing. I am using SFML, but this might not be related to the problem. I am calculating the delta time in the following code snippet:
[CODE]
sf::Clock deltaClock;
while (window.isOpen())
{
sf::Time elapsed = deltaClock.restart();
std::cout << "Delta: " << elapsed.asMilliseconds() << "\n";
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed) {
window.close();
}
}
}
[/CODE]
The problem that I am having is that the delta time is normal, staying between 15-17, and mostly at 16, which should be correct for a 60fps game. However, every once and a while, the delta time for a frame goes up to 25 and then back down to 16. Should I be worried about this? What could be causing this random fluctuation?
Thanks guys, that solved it :)
And I'm using the Field NONE cause it looks cleaner using it in a constructor of an external DLL:
[code]
Id = TextCreate(font, size, type.HasFlag(TypeFace.BOLD))
[/code]
I also could do it with a null check, will see
@AlternativeAccount
okay, think I will read about it some more, since it is used quite often (P/Invoke etc.)
-snip-
Anyone have any idea where atom.io gets installed after building? I just spent over half an hour building it and it's nowhere to be found.
[QUOTE=Sombrero;44898081]Anyone have any idea where atom.io gets installed after building? I just spent over half an hour building it and it's nowhere to be found.[/QUOTE]
What are you building it on/with?
[QUOTE=rookwood101;44898783]What are you building it on/with?[/QUOTE]
I followed the instructions on atom's wiki. It uses coffescript, and it says it's suppose to go to program files, but it didn't end up there.
What's the best way to draw sprites in OpenGL4+?
Is binding to a VBO slow? Can I just bind all of the sprite coordinates to one VBO every frame and draw them or is it more difficult than that?
[QUOTE=reevezy67;44900532]What's the best way to draw sprites in OpenGL4+?
Is binding to a VBO slow? Can I just bind all of the sprite coordinates to one VBO every frame and draw them or is it more difficult than that?[/QUOTE]
I found that the best way was to batch all your sprites into one VBO every frame and draw it.
However, some people will argue that based on the platform, other drawing methods are slightly faster. Personally, I never had a problem drawing large amounts of sprites using a VBO.
That's what I was going to do, so binding the VBO every frame is ok? I'm not looking for perfect, just relatively fast.
[QUOTE=reevezy67;44900532]What's the best way to draw sprites in OpenGL4+?
Is binding to a VBO slow? Can I just bind all of the sprite coordinates to one VBO every frame and draw them or is it more difficult than that?[/QUOTE]
2D sprites are really simple, so I'd say you allocate a fairly large buffer up front and then fill that up one-by-one. If you ever run out of space, make it bigger or make a second one. If a sprite stays in the same location, you don't have to update it either.
So you'd have something like this pseudocode (don't forget the VAO as well, that helps):
[code]
for i, 0 to num_sprites:
vbo[i ] = sprites[i].bot_left
vbo[i+1] = sprites[i].bot_right
vbo[i+2] = sprites[i].top_right
vbo[i+3] = sprites[i].top_left
//Fill the IBO with 0,1,2,3, PRI, 4,5,6,7, PRI, etc
//Where PRI is specified by glPrimitiveRestartIndex(NUMBER_GOES_HERE)
//NUMBER_GOES_HERE will become the PRI
//Later, draw with glDrawElements and GL_TRIANGLE_STRIP
[/code]
Use a texture atlas or an array texture with this.
[editline]24th May 2014[/editline]
[QUOTE=reevezy67;44900735]That's what I was going to do, so binding the VBO every frame is ok? I'm not looking for perfect, just relatively fast.[/QUOTE]
If you're looking for REALLY fast, use glMapBuffer, then spawn a worker thread or two to fill up the VBO from your sprites ([I]most[/I] containers are thread-safe for read-only, but some are not, be very careful here), then glUnmapBuffer and you're good to go.
This is almost certainly overkill for most purposes.
Anyone have any idea what my issue might be? The program is supposed to draw a triangle and it does it but it is always black, no matter what.
[url]http://pastebin.com/Vpx7xGzZ[/url]
That's the code. Any help would be greatly appreciated.
[QUOTE=KatNotDinner;44902126]Anyone have any idea what my issue might be? The program is supposed to draw a triangle and it does it but it is always black, no matter what.
[url]http://pastebin.com/Vpx7xGzZ[/url]
That's the code. Any help would be greatly appreciated.[/QUOTE]
gl_FragColor is deprecated, you need to have an "out vec4" (which you do, but for some reason is commented out?).
Doesn't work. I have updated the link with the new code. PS: I had actually used this method before but it didn't work, hence why out vec4 was commented out.
[QUOTE=KatNotDinner;44902126]Anyone have any idea what my issue might be? The program is supposed to draw a triangle and it does it but it is always black, no matter what.
[url]http://pastebin.com/Vpx7xGzZ[/url]
That's the code. Any help would be greatly appreciated.[/QUOTE]
Maybe try drawing triangle in another direction? (clockwise instead of counterclockwise)
What do you mean?
I just started writing a bot with autohotkey and I love it.
Does anyone know if there are any plugins for notepad++ that can auto format my code?
Its a whole jumbled mess and would be nice if I could autoformat it like in C#. Or if someone knows another program I can write autohotkey scripts in like writing C# in visual studio.
Sorry, you need to Log In to post a reply to this thread.