07-09-2009
Your post is useless because there's no code to debug. None of us here have a crystal ball. Try putting some code up so people can look at it.
How did you expect us to be able to provide insight into what is wrong if there's nothing to look at?
10 More Discussions You Might Find Interesting
1. Programming
there seems not to be error in this segment. In some computers, it can work well. But in others, it will give a failure.
why it ocurrs and how to deal with it?
in a function:
if( *ver == NULL ) {
*ver = (vertex *) malloc(sizeof(vertex)); //this line
... (17 Replies)
Discussion started by: cdbug
17 Replies
2. UNIX for Advanced & Expert Users
I was running a program and it stopped and showed "Out of Memory!". at that time, the RAM used by this process is around 4G and the free memory size of the machine is around 30G. Does anybody know what maybe the reason? this program is written with Perl. the OS of the machine is Solaris U8. And I... (1 Reply)
Discussion started by: lilili07
1 Replies
3. Programming
Hi everyone
I am developing an utility.
At some part of it I read directory entries to a dynamic array: struct list
It stores pointers to items: list.entries,
which are structures: struct entry
If a number of files in a directory is greater then number of elements an array was initially... (11 Replies)
Discussion started by: torbium
11 Replies
4. Programming
Hi All,
I have a simple code which does some computation by matching string patterns.
In brief:
1. The code reads .dat and .txt files.
2. .dat files are huge text files and .txt files contain some important words.
3. I am just doing strstr to find the patterns.
4. The function returns the... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
5. Programming
*** glibc detected *** ./a.out: malloc(): memory corruption (fast):
Posted A minute ago
M trying to make multiway tree and dont know what happend when this part of code get executed:
01void ins(NODE *ptr)
02{
03 //working
04 if(ptr!=NULL)
05 {
06 SNODE *var=NULL;
07 var=(SNODE... (3 Replies)
Discussion started by: exgenome
3 Replies
6. Programming
Hi Friends,
while executing the below code, am getting *** glibc detected *** ./ok: malloc(): memory corruption (fast) error, please suggest how to solve this issue.
#include <stdio.h>
#include <string.h>
#include <sqlca.h>
#include <alloca.h>
/* Define constants for VARCHAR... (2 Replies)
Discussion started by: mpjobsrch
2 Replies
7. Programming
I am facing a problem of memory corruption. The loop runs for the first time but does not go through the second time. What could be the problem?
for(int z=0;z<2;z++)
{
fp=fopen("poly.dat","r");
/*do something which reads this file into a 2D array*/
fclose(fp);
... (10 Replies)
Discussion started by: dare
10 Replies
8. Solaris
I am having a problem with shared memory corruption. I have two 86 servers running Solaris 10 (150400-06). One of the servers is accessed by a Sun Ray thin client Version 11.1.3.0.2.6. I login into server one from the thin client. I then ssh -X to server two. When a process that contains a... (2 Replies)
Discussion started by: salerno
2 Replies
9. Programming
I put together a C function to add strings to a dynamic array of strings (mostly for educational purpose to explain pointers to my kid). It works, but sometimes one or two strings in the array becomes corrupted. Running example on 64 bit Ubuntu, gcc ver. 4.8.4
Hope my code is self-explanatory:
... (2 Replies)
Discussion started by: migurus
2 Replies
10. Solaris
Hi,
I was wondering if any Solaris fellow out there has dealt with running Solaris 11 x86 on Local Zones for Oracle RAC (which may or may not be relevant to issue), running on HP gen h/w. Every so often could be weeks between issues or some times days, there will be a memory corruption and db... (2 Replies)
Discussion started by: crossmypath
2 Replies
LEARN ABOUT DEBIAN
sdlx::controller::interface
pods::SDLx::Controller::Interface(3pm) User Contributed Perl Documentation pods::SDLx::Controller::Interface(3pm)
NAME
SDLx::Controller::Interface - Interface Physics and Rendering with the Controller with callbacks
CATEGORY
Extension, Controller
SYNOPSIS
use SDL;
use SDLx::App;
use SDLx::Controller::Interface;
#SDLx::App is a controller
my $app = SDLx::App->new(width => 200, height => 200 );
my $ball = SDLx::Controller::Interface->new( x=> 10, y => 50, v_x => 10, v_y=> 20 );
#Set the initial state of the ball's physics, this is optional
$ball->set_acceleration(
sub {
my ($time, $current_state) = @_;
return( 0, -10, 0 ); # Return accelerations (x,y,rotation)
}
);
my $ball_render = sub {
my $state = shift;
$app->draw_rect( undef, 0 );
$app->draw_rect( [$state->x, $state->y, 10,10], [255,0,0,255] );
$app->update();
};
$ball->attach( $app, $ball_render, @params );
$app->run();
$ball->detach(); #can be called at anytime (for example when ball 'dies')
DESCRIPTION
METHODS
set_acceleration
Allows you to set the acceleration callback for defining the interface's behaviour in terms of x,y and rotation.
$interface->set_acceleration (
sub {
my ($time, $current_state) = @_;
return ( $accel_x, $accel_y, $torque );
}
);
These accelerations are arbitrary and can be set to any frame of reference. Your render callback will handle how to interpret it.
The callback will receive the time and the current state as a "SDLx::Controller::State" element.
attach
Attaches the interface to a controller with a render callback
$interface->attach( $controller, $render, @params );
Where $render is a callback that receives the interpolated "SDLx::Controller::State".
my $render = sub {
my ($state, @params) = @_;
# draw the current $state.
};
The @params are any extra parameters you would like to pass to the $render callback.
current
my $current_state = $interface->current();
Returns the current state of the interface as a "SDLx::Controller::State".
previous
my $previous_state = $interface->previous();
Returns the previous state of the interface as a "SDLx::Controller::State".
detach
$interface->detach();
If $interface has been "attach()"'ed to any controller it will be detached now.
OTHER METHODS
Don't use these unless you really really want to.
acceleration
Call the acceleration callback once.
interpolate
Interpolate the current state
evaluate
Evaluate the new current and previous state.
update
Update the states by integrating with time.
AUTHORS
See "AUTHORS" in SDL.
perl v5.14.2 2012-05-28 pods::SDLx::Controller::Interface(3pm)