本文整理汇总了C++中set_position函数的典型用法代码示例。如果您正苦于以下问题:C++ set_position函数的具体用法?C++ set_position怎么用?C++ set_position使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_position函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: position_changed
static gboolean position_changed(DBusConnection *connection, DBusMessage *msg,
void *user_data)
{
struct media_player *mp = user_data;
DBusMessageIter iter;
DBG("sender=%s path=%s", mp->sender, mp->path);
dbus_message_iter_init(msg, &iter);
set_position(mp, &iter);
return TRUE;
}
开发者ID:Andrewas,项目名称:android_hardware_semc,代码行数:14,代码来源:media.c
示例2: xmp_next_position
int xmp_next_position(xmp_context opaque)
{
struct context_data *ctx = (struct context_data *)opaque;
struct player_data *p = &ctx->p;
struct module_data *m = &ctx->m;
if (ctx->state < XMP_STATE_PLAYING)
return -XMP_ERROR_STATE;
if (p->pos < m->mod.len)
set_position(ctx, p->pos + 1, 1);
return p->pos;
}
开发者ID:wothke,项目名称:libxmp-4.3.0,代码行数:14,代码来源:control.c
示例3: tta_seek_sample
static int
tta_seek_sample (DB_fileinfo_t *_info, int sample) {
tta_info_t *info = (tta_info_t *)_info;
info->samples_to_skip = set_position (&info->tta, sample + info->startsample);
if (info->samples_to_skip < 0) {
fprintf (stderr, "tta: seek failed\n");
return -1;
}
info->currentsample = sample + info->startsample;
info->remaining = 0;
_info->readpos = sample / _info->fmt.samplerate;
return 0;
}
开发者ID:vadmium,项目名称:deadbeef,代码行数:15,代码来源:ttaplug.c
示例4: font_id
/**
* @brief Creates a text to display with the specified alignment properties.
* @param x x position of the text on the destination surface
* @param y y position of the text on the destination surface
* @param horizontal_alignment horizontal alignment of the text: ALIGN_LEFT,
* ALIGN_CENTER or ALIGN_RIGHT
* @param vertical_alignment vertical alignment of the text: ALIGN_TOP,
* ALIGN_MIDDLE or ALIGN_BOTTOM
*/
TextSurface::TextSurface(int x, int y,
TextSurface::HorizontalAlignment horizontal_alignment,
TextSurface::VerticalAlignment vertical_alignment):
font_id(default_font_id),
horizontal_alignment(horizontal_alignment),
vertical_alignment(vertical_alignment),
rendering_mode(TEXT_SOLID),
surface(NULL) {
text = "";
set_text_color(Color::get_white());
set_background_color(Color::get_black());
set_position(x, y);
}
开发者ID:Aerospyke,项目名称:solarus,代码行数:24,代码来源:TextSurface.cpp
示例5: set_position
int YARPMEIDeviceDriver::definePosition (void *cmd)
{
long rc = 0;
SingleAxisParameters *tmp = (SingleAxisParameters *) cmd;
double *pos = (double *)(tmp->parameters);
rc = set_position(tmp->axis, *pos);
/// this is to reset the encoder ref value.
/// LATER: need to verify whether summing pos is the right thing to do.
_position_zero[tmp->axis] = double(dsp_encoder (tmp->axis)) + *pos;
_winding[tmp->axis] = 0;
return rc;
}
开发者ID:robotology-legacy,项目名称:yarp1,代码行数:15,代码来源:YARPMEIDeviceDriver.cpp
示例6: set_position
MarqueeView::MarqueeView()
{
style = 0;
set_position( 0, 0, 0, 0 );
Visible = FALSE;
text_size = 14.0;
font_height = 2*text_size;
font = &SerifTypeface;
calc_margins( 0.1 );
text_color = 0xFF9f9f0f;
border_color = 0xFFffffff;
background_color = 0xFf202020;
strcpy (class_name, "MarqueeView");
}
开发者ID:stenniswood,项目名称:bk_code,代码行数:15,代码来源:marquee.cpp
示例7: dig
void dig(int **puz, int x, int y, int emp_lim, int rc_lim){
/*randomly empties positions of a completed sudoku to generate a new puzzle, according to the limits passed*/
int g = 0, v, s;
srand(time(NULL));
while(g <= emp_lim){
if(puz[x][y]){
if((v = check_row(puz, x, rc_lim)) && (s = check_col(puz, y, rc_lim))){
g++;
puz[x][y] = EMPTY;
}
}
set_position(&x, &y);
}
return;
}
开发者ID:kmkangutkar,项目名称:mini-proj,代码行数:15,代码来源:functions.c
示例8: score
score(const sf::Vector2f& position)
: m_text_size(m_mult*(position.x + position.y)), m_font(), m_text()
{
assert(m_score_name != "");
assert(m_score == 0);
set_font();
set_text_font();
set_text_size();
set_color();
textify_score();
set_origin();
set_position(position);
}
开发者ID:janderkkotlarski,项目名称:Gravtacles,代码行数:16,代码来源:Gravtacles_V0-7.cpp
示例9: xmp_set_position
int xmp_set_position(xmp_context opaque, int pos)
{
struct context_data *ctx = (struct context_data *)opaque;
struct player_data *p = &ctx->p;
struct module_data *m = &ctx->m;
if (ctx->state < XMP_STATE_PLAYING)
return -XMP_ERROR_STATE;
if (pos >= m->mod.len)
return -XMP_ERROR_INVALID;
set_position(ctx, pos, 0);
return p->pos;
}
开发者ID:GCrean,项目名称:libxmp,代码行数:16,代码来源:control.c
示例10: uci
void uci(void) {
/* printf("Entering UCI mode. Type in commands here (quit to quit, help for a list of commands)\n\n"); */
// Default state
isWhitesMove=1;
//set_position_startpos();
FILE *fp;
fp=fopen("chess.log", "a");
fprintf(fp, "---- CHESS v0.0 ------------\n");
int keep_going = 1;
char string[256];
while (keep_going == 1) {
//printf( "Command: " );
fflush (stdout);
int x = scanf ("%79s",string);
fprintf(fp, "Received command: %s\n", string);
if (strcmp(string, "quit")==0) {
keep_going = 0;
} else if (strcmp(string, "uci")==0) {
show_uci_info();
} else if (strcmp(string, "isready")==0) {
is_ready();
} else if (strcmp(string, "position")==0) {
set_position();
} else if (strcmp(string, "go")==0) {
go();
} else if (strcmp(string, "stop")==0) {
stop();
} else if (strcmp(string, "draw")==0) {
draw();
} else if (strcmp(string, "move")==0) {
uci_make_move();
} else if (strcmp(string, "dumpmoves")==0) {
dump_moves();
} else if (strcmp(string, "info")==0) {
info();
} else if (strcmp(string, "test")==0) {
run_tests();
} else {
printf( "Unknown command: %s\n", string );
}
}
fclose(fp);
}
开发者ID:a-thomson,项目名称:brutus,代码行数:46,代码来源:uci.c
示例11: set_position
ui::menu::menu()
{
set_position(window::center.x,window::center.y);
fill_color=default_fillcolor;
border_color=default_bordercolor;
set_texture(default_texture);
set_mask(default_mask);
set_title("menu");
title.set_font("helvetica",18);
subtitle.set_font("helvetica",12);
subtitle.hide();
layout=default_layout;
spacing=default_spacing;
margin=default_margin;
bordered=true;
std::clog<<"object#"<<number<<"(menu)"<<" created.\n";
}
开发者ID:confuzedskull,项目名称:G2,代码行数:17,代码来源:menu.cpp
示例12: main
int main(void)
{
int player_x,player_y;
player_x = player_y = 0;
printf("player_x = %d\n",player_x);
printf("player_y = %d\n",player_y);
printf("°ÜÆ°\n");
set_position(&player_x,&player_y);
printf("player_x = %d\n",player_x);
printf("player_y = %d\n",player_y);
return 0;
}
开发者ID:ainehanta,项目名称:J2program,代码行数:17,代码来源:No1009_3.c
示例13: home_all
void home_all(void)
{
if (homing_state[pivot] != homed)
set_position(gripper, 10, 0.3, -0.3);
home(pivot);
if (homing_state[pivot] == homed)
home(gripper);
if (homing_state[gripper] == homed)
home(elevator);
// !!
if (homing_state[elevator] == homed)
home(mini);
}
开发者ID:frcteam195,项目名称:OldCode,代码行数:17,代码来源:Logomoton+Nationals+(FineTune+B).cpp
示例14: sniper
void sniper()
{
init_all();
// set voltage reference to 5V
clear(ADMUX, REFS1);
set(ADMUX, REFS0);
m_disableJTAG();//allowing gpio of F pins
//setting ADC prescaler
set(ADCSRA,ADPS2);
set(ADCSRA,ADPS1);
set(ADCSRA,ADPS0);
//setting pins to turn off digital circuitry
set(DIDR0,ADC1D);//setting F1
set(DIDR0,ADC4D);//setting F4
set(DIDR0,ADC5D);//setting F5
set(DIDR0,ADC6D);//setting F6
set(DIDR0,ADC7D);//setting F7
set(ADCSRA, ADEN);
play_state = 1;
set_position(1024/2, 768/2);
first = true;
//state_before_game();
//state_play();
m_usb_init();
/* while(!m_usb_isconnected());
m_green(ON);
*/
set_left(30);
set_right(100);
while(1)
{
adc();
// m_usb_tx_string("left: ");
//m_usb_tx_int(a_left);
wait(1);
}
}
开发者ID:andyguenin,项目名称:Robockey,代码行数:46,代码来源:sniper.c
示例15: set_default_size
ViewLogFileWindow::ViewLogFileWindow(const std::string& PathToLogFile)
{
set_default_size(500, 350);
set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
set_title(_("Install log"));
m_CloseButton.set_label(_("Close"));
m_RefLogTextBuffer = Gtk::TextBuffer::create();
m_RefLogTextBuffer->set_text("");
m_LogTextView.set_editable(false);
m_LogTextView.set_buffer(m_RefLogTextBuffer);
m_LogTextView.set_wrap_mode(Gtk::WRAP_WORD);
m_LogSWindow.add(m_LogTextView);
m_LogSWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_VBox.set_border_width(12);
m_VBox.pack_start(m_LogSWindow,Gtk::PACK_EXPAND_WIDGET,12);
m_VBox.pack_start(m_CloseButton,Gtk::PACK_SHRINK,12);
add(m_VBox);
m_CloseButton.signal_clicked().connect(
sigc::mem_fun(*this, &ViewLogFileWindow::onCloseClicked)
);
std::ifstream LogFile(PathToLogFile.c_str());
std::string Line, FullContent;
while(getline(LogFile,Line))
{
FullContent += Line + "\n";
}
LogFile.close();
m_RefLogTextBuffer->set_text(FullContent);
show_all_children();
set_modal(true);
}
开发者ID:VaysseB,项目名称:openfluid,代码行数:45,代码来源:ViewLogFileWindow.cpp
示例16: init_from
// ----------------------------------------------------------------------
void
JumpMovement::
init_from( Node& v,
NodeMovement& nm )
throw()
{
set_node(v);
set_position(nm.position());
if ( update_mask_[JumpMovement::X] )
pos_ = Vec( update_pos_[JumpMovement::X], pos_.y(), pos_.z() );
if ( update_mask_[JumpMovement::Y] )
pos_ = Vec( pos_.x(), update_pos_[JumpMovement::Y], pos_.z() );
if ( update_mask_[JumpMovement::Z] )
pos_ = Vec( pos_.x(), pos_.y(), update_pos_[JumpMovement::Z] );
movement_initial_boxes();
}
开发者ID:MarcStelzner,项目名称:shawn,代码行数:19,代码来源:jump_movement.cpp
示例17: set_position
void Light::render(const CameraApiPtr& camera)
{
// if attached to target...
if (m_target)
{
// set position based on target
set_position(m_target->get_absolute_position() + m_offset_from_target);
// if target is removed from parent and need to remove this light:
if (m_remove_with_target && m_target->parent() == nullptr)
{
m_target.reset();
remove_from_parent();
return;
}
}
Entity::render(camera);
}
开发者ID:RonenNess,项目名称:ness-engine,代码行数:18,代码来源:light_node.cpp
示例18: main
task main ()
{
// resets odometry
AcquireMutex(semaphore_odometry);
set_position(robot_odometry, 0, 0, 0);
ReleaseMutex(semaphore_odometry);
// resets motor encoders
hogCPU();
nMotorEncoder[motorA] = 0;
nMotorEncoder[motorC] = 0;
releaseCPU();
StartTask(updateOdometry);
track_wall();
StopTask(updateOdometry);
}
开发者ID:FelinoSoft,项目名称:FelinoRobotics,代码行数:18,代码来源:follow_wall.c
示例19: set_position
void Stats::update(){
if (po->get_height()!=currentPo){
if (po->get_height()<currentPo) po->set_height(po->get_height()+1);
else po->set_height(po->get_height()-1);
}
if (sp->get_height()!=currentSp){
if (sp->get_height()<currentSp) sp->set_height(sp->get_height()+1);
else sp->set_height(sp->get_height()-1);
}
if (de->get_height()!=currentDe){
if (de->get_height()<currentDe) de->set_height(de->get_height()+1);
else de->set_height(de->get_height()-1);
}
set_position(background->get_x(),background->get_y());
}
开发者ID:namelivia,项目名称:open-heavy-smash,代码行数:18,代码来源:Stats.cpp
示例20: while
void X11Window::map_window()
{
// Clear exisitng StructureNofify events.
XEvent event;
while(XCheckMaskEvent(handle.display, StructureNotifyMask, &event));
if (is_window_mapped)
{
if (!is_minimized())
{
log_event("debug", "clan::X11Window::map_window(): Window already mapped.");
return;
}
else
log_event("debug", "clan::X11Window::map_window(): Mapping minimized window.");
}
log_event("debug", "clan::X11Window::map_window(): Mapping window...");
int result = XMapWindow(handle.display, handle.window);
if ((result == BadValue) || (result == BadWindow))
throw Exception("Failed to map window.");
XFlush(handle.display);
do {
XWindowEvent(handle.display, handle.window, StructureNotifyMask, &event);
} while (event.type != MapNotify);
XFlush(handle.display);
is_window_mapped = true;
if (fullscreen)
{
XSetInputFocus(handle.display, handle.window, RevertToParent, CurrentTime);
XFlush(handle.display);
}
else
{
update_frame_extents();
set_position(client_area, true);
}
request_repaint();
}
开发者ID:xubingyue,项目名称:ClanLib,代码行数:44,代码来源:x11_window.cpp
注:本文中的set_position函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论