[QUOTE=blacksam;44438934]Anyone have a good tutorial on swing for java? I'm getting sexually frustrated with the Oracle one.[/QUOTE]
What are you trying to do?
[QUOTE=Contron;44439497]What are you trying to do?[/QUOTE]
It's for class. Pretty free form for the most part minus not being able to use drag and drop windows like netbeans has to offer.
I'm making a hangman game because I already wrote it as a side personal project.
I showed it off once in the other thread.
[IMG]http://i.imgur.com/l05TGeG.gif?1[/IMG]
[QUOTE=blacksam;44439648]It's for class. Pretty free form for the most part minus not being able to use drag and drop windows like netbeans has to offer.
I'm making a hangman game because I already wrote it as a side personal project.
I showed it off once in the other thread.
[IMG]http://i.imgur.com/l05TGeG.gif?1[/IMG][/QUOTE]
Right, so what's causing you trouble? If it's with a specific component for instance, most of the JavaDoc pages for the respective component usually have a well-enough example on how to use it properly.
[QUOTE=Contron;44439729]Right, so what's causing you trouble? If it's with a specific component for instance, most of the JavaDoc pages for the respective component usually have a well-enough example on how to use it properly.[/QUOTE]
I was wondering if there was a better tutorial. If not, I'll go back to buckling down and figuring it out.
[QUOTE=blacksam;44439781]I was wondering if there was a better tutorial. If not, I'll go back to buckling down and figuring it out.[/QUOTE]
You could try check out [url=http://zetcode.com/tutorials/javaswingtutorial/]this one[/url] which covers Swing in general (and includes a section about drag and drop, so you could have a look about implementing the drag and drop windows you mentioned earlier).
You could also look at the [url=https://netbeans.org/kb/docs/java/quickstart-gui.html]NetBeans Swing quickstart guide.[/url]
Hope this helps.
How do I go on about making this work by making it print the whole value and not just the first character?
[CODE]
const std::string s_msg_tbag = "FUCK YOU";
const char *c_msg_tbag = s_msg_tbag.c_str();
const std::string s_execute(10, *c_msg_tbag);
[/CODE]
When I run the program, it runs 'F' instead of 'FUCK YOU'. I want to use this method to create the string and not by assigning it with '='.
Anyone familiar with the Mode7 effect of the Super Nintendo? I want to recreate that for a school project, so I already know I have to use a perspective transformation matrix to "ride" an image, but how can i achieve this in Java2D?
[QUOTE=Porky.;44440317]How do I go on about making this work by making it print the whole value and not just the first character?
[CODE]
const std::string s_msg_tbag = "FUCK YOU";
const char *c_msg_tbag = s_msg_tbag.c_str();
const std::string s_execute(10, *c_msg_tbag);
[/CODE]
When I run the program, it runs 'F' instead of 'FUCK YOU'. I want to use this method to create the string and not by assigning it with '='.[/QUOTE]
I'm really not sure what you're even trying to do but you're dereferencing c_msg_tbag in the constructor to s_execute and sending it a single char. [url=http://en.cppreference.com/w/cpp/string/basic_string/basic_string]I'm pretty sure the constructor you're calling for s_execute is the one that would create a string with F in it ten times[/url]. Why are you creating a string and then creating another one with the c string of it?
[QUOTE=Philly c;44441364]I'm really not sure what you're even trying to do but you're dereferencing c_msg_tbag in the constructor to s_execute and sending it a single char. [url=http://en.cppreference.com/w/cpp/string/basic_string/basic_string]I'm pretty sure the constructor you're calling for s_execute is the one that would create a string with F in it ten times[/url]. Why are you creating a string and then creating another one with the c string of it?[/QUOTE]
So there's no way to send multiple chars instead of only sending 1 char using that method? My program isn't meant to do much other than what is already displayed there though...
[QUOTE=Porky.;44441512]So there's no way to send multiple chars instead of only sending 1 char using that method? My program isn't meant to do much other than what is already displayed there though...[/QUOTE]
Yeah you can, just do
const std::string s_execute(c_msg_tbag);
or just
const std::string s_execute(s_msg_tbag.c_str());
or even better just do it with the std::string itself
const std::string s_execute(s_msg_tbag);
But even so I'm not sure what you're trying to do, unless you needed it to be copied which in that case fair enough, it's unclear from that snippet.
[QUOTE=Philly c;44441577]Yeah you can, just do
const std::string s_execute(c_msg_tbag);
or just
const std::string s_execute(s_msg_tbag.c_str());
or even better just do it with the std::string itself
const std::string s_execute(s_msg_tbag);
But even so I'm not sure what you're trying to do, unless you needed it to be copied which in that case fair enough, it's unclear from that snippet.[/QUOTE]
Yes, I wanted to paste that code but x amount of times, in this case 10 times :v:
for loop ?
Does anyone know why when I take my mouse off of my SDL OpenGL window my SDL events draw faster? The game appears to be speeding up? I have commented out all my mouse events...
[QUOTE=Porky.;44441737]Yes, I wanted to paste that code but x amount of times, in this case 10 times :v:[/QUOTE]
Yeah shit I totally misunderstood. Just loop 10 times and add that string to another.
[QUOTE=Philly c;44442262]Yeah shit I totally misunderstood. Just loop 10 times and add that string to another.[/QUOTE]
alright thanks :D
i knew it was possible to do it with a for loop but im trying to find different ways to produce the same code as a for loop but using the STL
[QUOTE=bootv2;44449277]I played around for a while on heroku, and tried to implement this shader as a background in sfml2.1.
[url]http://glsl.heroku.com/e#15698.0[/url]
I loaded the shader as a fragment shader, passed it the time and resolution variables as float and sf::vector2f(and update time every frame). I also have a sf::RectangleShape as big as the window's resolution at coordinates 0,0. And draw the shader with the shape.
But I only get a very dark version of the green strand on my screen, it is moving, but barely visible.
Example:
[img]http://i.gyazo.com/d0ae2c127cd2b9b5f2fab3be8c97ba30.png[/img]
code:
[code]
//c++11(visual studio 2013)
Engine constructor
{
if (sf::Shader::isAvailable())
shaderSupported = true;
else
shaderSupported = false;
if (shaderSupported)
{
if (!bgshader.loadFromFile("res/shader/background.glsl", sf::Shader::Fragment))
std::cerr << "(FATAL) SHADER LOAD FAILURE(bgshader)\n";
}
bgshaderShape.setSize(sf::Vector2f(windowWidth, windowHeight));
bgshaderShape.setPosition(sf::Vector2f(0, 0));
bgshader.setParameter("resolution", sf::Vector2f(windowWidth, windowHeight));
bgshader.setParameter("time", 0.0f);
}
Engine gameLoop
{
rWindow->clear(sf::Color::Black);
bgshader.setParameter("time", (float )framenum / 20.f);//temporary
rWindow->draw(bgshaderShape, &bgshader);
rWindow->display();
framenum++;
}
[/code]
ideas?[/QUOTE]
codeXL, analyse/debug your app
annoying friend has driven me to this, but anyway..
i'm looking to get started in phone programming, specifically just 2d games. This is just playing around with things but are there any simple designer programs that have shortcuts for GUI and controls or even examples of games?
I'm trying to implement a scene graph in my SFML game and have some problems with transformation and drawing order.
Right now my graph consists of a tree of objects which inherit sf::Drawable and sf::Transformable. I thought I could just traverse the graph, apply the transformations and draw the objects, but this would restrict me somewhat: SFML does not use a z coordinate, but each draw call just draws on top of everything else already in the buffer. Having that scene graph now means that the drawing order is bound to the graph node parenting. My brain tells me that spatial parenting and drawing order should be separated.
An example would be the layers:[code]PLAYER
GLASS
SHADOW
FLOOR[/code]where the shadow is spatially bound to the player (moves along), but having the static glass layer visually between it and the player.
So to get that working I thought about splitting the structure: The scene graph would just take care of the transformation (i.e. spatial parenting) and for drawing order, I would maintain a separate sorted list with z values for each entity.
The drawback here is, that now I would have to iterate through the list of ordered objects, and for each object find the correct node in the graph, then recursively calculate the world coordinates of that, transform it and draw it. This sounds like a lot more computational work that the straight forward graph traversal.
Is there a better approach to get this working?
[QUOTE=Dark One;44450139]annoying friend has driven me to this, but anyway..
i'm looking to get started in phone programming, specifically just 2d games. This is just playing around with things but are there any simple designer programs that have shortcuts for GUI and controls or even examples of games?[/QUOTE]
"Phone programming" is pretty vague, I think both Android and iOS's default IDEs have a visual GUI editor. Or if you're experienced with html and CSS you could create a mobile game that way
[QUOTE=Dienes;44450477]So to get that working I thought about splitting the structure: The scene graph would just take care of the transformation (i.e. spatial parenting) and for drawing order, I would maintain a separate sorted list with z values for each entity.
The drawback here is, that now I would have to iterate through the list of ordered objects, and for each object find the correct node in the graph, then recursively calculate the world coordinates of that, transform it and draw it. This sounds like a lot more computational work that the straight forward graph traversal.[/QUOTE]
This approach is what I'm doing in my SFML game, except I'm also caching the world-space transform for each entity.
How can I make a shader an effect similar to this?(GLSL)
[IMG]http://www.klopfenstein.net/public/Uploads/lorenz/xna_contest/xna_08_final.jpg[/IMG]
I've already modified a shader I got by googling, this is what it looks like now:[IMG]http://i.imgur.com/LIJxzwr.png[/IMG]
so basically the whole effect is inside the sphere
the fragment shader code is
[code]
vec3 flare(vec2 spos, vec2 fpos, vec3 clr)
{
vec3 color;
float d = distance(spos, fpos-0.5);
vec2 dd;
dd.x = spos.x - fpos.x;
dd.y = spos.y - fpos.y;
dd = abs(dd);
color += clr * max(0.0, 0.3 / d);
color += clr * max(0.0, 0.0 - distance(spos, -fpos * 0.5)) * 2.0 ;
return color;
}
void main( void ) {
vec2 position = ( gl_FragCoord.xy / vec2(1024,512) * 2. ) - 1.0;
position.x *= 1024./512.;
vec3 color = flare(position, vec2(1,1) , vec3(0.5, 0.8, 1.5));
gl_FragColor = vec4( color * 3. * vec3(0.7,0.3,0.1) *(0.95 +85.* 0.05), 1.0 );
}[/code]
[QUOTE=Z_guy;44450619]This approach is what I'm doing in my SFML game, except I'm also caching the world-space transform for each entity.[/QUOTE]
So I'm on the right track.
How do you cache the transform? Does a move operation on a node cause the cache of all children to be invalidated?
[QUOTE=trashmaster;44452211]How can I make a shader an effect similar to this?(GLSL)
[IMG]http://www.klopfenstein.net/public/Uploads/lorenz/xna_contest/xna_08_final.jpg[/IMG]
I've already modified a shader I got by googling, this is what it looks like now:[IMG]http://i.imgur.com/LIJxzwr.png[/IMG]
so basically the whole effect is inside the sphere
the fragment shader code is
[code]
vec3 flare(vec2 spos, vec2 fpos, vec3 clr)
{
vec3 color;
float d = distance(spos, fpos-0.5);
vec2 dd;
dd.x = spos.x - fpos.x;
dd.y = spos.y - fpos.y;
dd = abs(dd);
color += clr * max(0.0, 0.3 / d);
color += clr * max(0.0, 0.0 - distance(spos, -fpos * 0.5)) * 2.0 ;
return color;
}
void main( void ) {
vec2 position = ( gl_FragCoord.xy / vec2(1024,512) * 2. ) - 1.0;
position.x *= 1024./512.;
vec3 color = flare(position, vec2(1,1) , vec3(0.5, 0.8, 1.5));
gl_FragColor = vec4( color * 3. * vec3(0.7,0.3,0.1) *(0.95 +85.* 0.05), 1.0 );
}[/code][/QUOTE]
so you want to have a glow outside of the mesh ?
if yes you should render a 2nd mesh over your screen or the previous mesh just a bit bigger and apply the effect there.
e.g. multiply the color of the already rendered stuff by a value ...
[QUOTE=Dienes;44452804]Does a move operation on a node cause the cache of all children to be invalidated?[/QUOTE]
Yes, exactly. Just remember to set a dirty flag and only recalculate when the value is needed instead of recalculating right away, since the cache might be invalidated several times per frame.
What's a good alternative to PyCrypto? Currently I have Python v 3.4 and can only find binaries for 3.3. I've tried all day to get the latest version of pycrypto to build but since I'm on Windows, it's been failing all day. I really don't want to have to install linux on virtualbox just to build the latest version...
Can somebody please check this work for me. I'm trying to learn programming by distance education and I'm not sure if I'm going about it right. - I've emailed the lecturer but he's hopeless and never gets back to me.
[IMG]http://i57.tinypic.com/qqpq46.jpg[/IMG]
That's the question with my answers. I'm not confident I totally understand it so any help would be greatly appreciated!
By all appearances, the flowchart is fine. I don't know Scratch yet, but it might be a problem if your 'repeat until' skips over the stuff inside it if x is 5 or greater than 5 already. Then your flow chart would be invalid. As for your desk check, you might want to add 'DON'T LOOP' near the end, contrasting against your 'LOOP' statement.
Which parts don't you understand?
I guess I think I understand, but I feel uncertain about it all. With the flowchart, the decision box, is it okay if it has "Is X<5 or = 5?" - Like, can it have two things in one like that.
And as for the desk check, this is the first desk check I've had to do, so I'm not sure how it's supposed to look or be formatted. Would it be okay to just write it like how I did?
[quote]Begin
Set X=1
Set Y=1
(Set y to (y+x)
(Change x by 2)
X=3
Y=4
X IS NOT <5 OR = 5; LOOP
X=5
Y=7
X IS = 5; DO NOT LOOP
End[/quote]
Are you saying that's fine like that? (Thanks for the help, by the way)
Hello, members of community.
Can anyone tell me how disassemblers calculate absolute CALL/JMP address from an offset?
00000622 E8 89FA0000 CALL 000100B0h
For example, i have [B]CALL 000100B0h[/B] shown in debugger,
but real bytes are:
[B]00000622 E8 89FA0000[/B], where [B]00000622[/B] is address, where the instruction lies in, and
[B]E8 89FA0000[/B] is the instruction itself.
I'm just too confused :/
[QUOTE=Just2Rusty;44458021]I guess I think I understand, but I feel uncertain about it all. With the flowchart, the decision box, is it okay if it has "Is X<5 or = 5?" - Like, can it have two things in one like that.
And as for the desk check, this is the first desk check I've had to do, so I'm not sure how it's supposed to look or be formatted. Would it be okay to just write it like how I did?
Are you saying that's fine like that? (Thanks for the help, by the way)[/QUOTE]
As far as I know in the industry, there's no standard for flowchart representations of code or desk checks. Which is good, because it means you can do it whichever way you want. As high level or low level as you wish. In whatever language you want. Personally I desk check in my head and write flowcharts on a notepad (I can't visualize these oddly) and finalize them on a computer.
Your biggest obstacle right now would be your educators who choose what to accept, and unless they've provided any specifications on how to format things, I'd say it's fair game.
Sorry, you need to Log In to post a reply to this thread.