Search Results

Search found 17342 results on 694 pages for 'custom draw'.

Page 58/694 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Custom deleters for std::shared_ptrs

    - by Kristian D'Amato
    Is it possible to use a custom deleter after creating a std::shared_ptr without using new? My problem is that object creation is handled by a factory class and its constructors & destructors are protected, which gives a compile error, and I don't want to use new because of its drawbacks. To elaborate: I prefer to create shared pointers like this, which doesn't let you set a custom deleter (I think): auto sp1 = make_shared<Song>(L"The Beatles", L"Im Happy Just to Dance With You"); Or I can create them like this, which does let met set a deleter through an argument: auto sp2(new Song, MyDeleterFunc); But the second one uses new, which AFAIK isn't as efficient as the top sort of allocation. Maybe this is clearer: is it possible to get the benefits of make_shared<> as well as a custom deleter? Would that mean having to write an allocator?

    Read the article

  • parallel.foreach with custom collection

    - by SchwartzE
    I am extending the System.Net.Mail.MailAddress class to include an ID field, so I created a new custom MailAddress class that inherited from the existing class and a new custom MailAddressCollection class. I then overrode the existing System.Net.Mail.MailMessage.To to use my new collection. I would like to process the recipients in parallel, but I can't get the syntax right. This is the syntax I am using. Parallel.ForEach(EmailMessage.To, (MailAddress address) => { emailService.InsertRecipient(emailId, address.DisplayName, address.Address, " "); }); I get the following errors: The best overloaded method match for 'System.Threading.Tasks.Parallel.ForEach(System.Collections.Generic.IEnumerable, System.Action)' has some invalid arguments Argument 1: cannot convert from 'EmailService.MailAddressCollection' to 'System.Collections.Generic.IEnumerable' What syntax do I need to use custom collections?

    Read the article

  • What is a Custom Class?

    - by John Saunders
    Many questions here on SO ask about custom classes. I, on the other hand, have no idea what they're talking about. "Custom class" seems to mean the same thing I mean when I say "class". What did I miss, back in the '80s, that keeps me from understanding? I know that it's possible to purchase a packaged system - for Accounting, ERP, or something like that. You can then customize it, or add "custom code" to make the package do things that are specific to your business. But that doesn't describe the process used in writing a .NET program. In this case, the entire purpose of the .NET Framework is to allow us to write our own code. There is nothing useful out of the box.

    Read the article

  • Objective C - Custom Getter with inheritance

    - by anhdat
    Recently I have worked with Core Data. When I want to set a default value for some fields, I came up with this problem: So I made a simple represent: We have 2 class Parent and Child, in which Child inherit from Parent. // Parent.h @interface Parent : NSObject @property (strong, nonatomic) NSString *lastName; // Child.h @interface Child : Parent In Parent class, I made a custom getter to set a default value when nothing is set: // Parent.h - (NSString *)lastName { if (_lastName) { return _lastName; } else { return @"Parent Default Name"; } } But I cannot make a custom default value for the field "name" which Child inherits from its Parent. // Child.h @implementation Child - (NSString *)lastname { if (super.lastName) { return super.lastName; } else { return @"Child Default Name"; } } Apparently, this method is never called. So my question here is: How can I set a custom getter for the field the Child class inherits from Parent without define an overriding property?

    Read the article

  • why are my players drawn to the side of my viewport

    - by Jetbuster
    Following this admittedly brilliant and clean 2d camera class I have a camera on each player, and it works for multiplayer and i've divided the screen into two sections for split screen by giving each camera a viewport. However in the game it looks like this I'm not sure if thats their position relative to the screen or what The relevant gameScreen code, the makePlayers is setup so it could theoretically work for up to 4 players private void makePlayers() { int rowCount = 1; if (NumberOfPlayers > 2) rowCount = 2; players = new Player[NumberOfPlayers]; for (int i = 0; i < players.Length; i++) { int xSize = GameRef.Window.ClientBounds.Width / 2; int ySize = GameRef.Window.ClientBounds.Height / rowCount; int col = i % rowCount; int row = i / rowCount; int xPoint = 0 + xSize * row; int yPoint = 0 + ySize * col; Viewport viewport = new Viewport(xPoint, yPoint, xSize, ySize); Vector2 playerPosition = new Vector2(viewport.TitleSafeArea.X + viewport.TitleSafeArea.Width / 2, viewport.TitleSafeArea.Y + viewport.TitleSafeArea.Height / 2); players[i] = new Player(playerPosition, playerSprites[i], GameRef, viewport); } //players[1].Keyboard = true; } public override void Draw(GameTime gameTime) { base.Draw(gameTime); foreach (Player player in players) { GraphicsDevice.Viewport = player.PlayerCamera.ViewPort; GameRef.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, player.PlayerCamera.Transform); map.Draw(GameRef.spriteBatch); // Draw the Player player.Draw(GameRef.spriteBatch); // Draw UI screen elements GraphicsDevice.Viewport = Viewport; ControlManager.Draw(GameRef.spriteBatch); GameRef.spriteBatch.End(); } } the player's initialize and draw methods are like so internal void Initialize() { this.score = 0; this.angle = (float)(Math.PI * 0 / 180);//Start sprite at it's default rotation int width = utils.scaleInt(picture.Width, imageScale); int height = utils.scaleInt(picture.Height, imageScale); this.hitBox = new HitBox(new Vector2(centerPos.X - width / 2, centerPos.Y - height / 2), width, height, Color.Black, game.Window.ClientBounds); playerCamera.Initialize(); } #region Methods public void Draw(SpriteBatch spriteBatch) { //Console.WriteLine("Hitbox: X({0}),Y({1})", hitBox.Points[0].X, hitBox.Points[0].Y); //Console.WriteLine("Image: X({0}),Y({1})", centerPos.X, centerPos.Y); Vector2 orgin = new Vector2(picture.Width / 2, picture.Height / 2); hitBox.Draw(spriteBatch); utils.DrawCrosshair(spriteBatch, Position, game.Window.ClientBounds, Color.Red); spriteBatch.Draw(picture, Position, null, Color.White, angle, orgin, imageScale, SpriteEffects.None, 0.1f); } as I said I think I'm gonna need to do something with the render position but I'm to entirely sure what or how it would be elegant to say the least

    Read the article

  • why are my players drawn top the side of my viewport

    - by Jetbuster
    Following this admittedly brilliant and clean 2d camera class I have a camera on each player, and it works for multiplayer and i've divided the screen into two sections for split screen by giving each camera a viewport. However in the game it looks like this I'm not sure if thats their position relative to the screen or what The relevant gameScreen code, the makePlayers is setup so it could theoretically work for up to 4 players private void makePlayers() { int rowCount = 1; if (NumberOfPlayers > 2) rowCount = 2; players = new Player[NumberOfPlayers]; for (int i = 0; i < players.Length; i++) { int xSize = GameRef.Window.ClientBounds.Width / 2; int ySize = GameRef.Window.ClientBounds.Height / rowCount; int col = i % rowCount; int row = i / rowCount; int xPoint = 0 + xSize * row; int yPoint = 0 + ySize * col; Viewport viewport = new Viewport(xPoint, yPoint, xSize, ySize); Vector2 playerPosition = new Vector2(viewport.TitleSafeArea.X + viewport.TitleSafeArea.Width / 2, viewport.TitleSafeArea.Y + viewport.TitleSafeArea.Height / 2); players[i] = new Player(playerPosition, playerSprites[i], GameRef, viewport); } //players[1].Keyboard = true; } public override void Draw(GameTime gameTime) { base.Draw(gameTime); foreach (Player player in players) { GraphicsDevice.Viewport = player.PlayerCamera.ViewPort; GameRef.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, player.PlayerCamera.Transform); map.Draw(GameRef.spriteBatch); // Draw the Player player.Draw(GameRef.spriteBatch); // Draw UI screen elements GraphicsDevice.Viewport = Viewport; ControlManager.Draw(GameRef.spriteBatch); GameRef.spriteBatch.End(); } } the player's initialize and draw methods are like so internal void Initialize() { this.score = 0; this.angle = (float)(Math.PI * 0 / 180);//Start sprite at it's default rotation int width = utils.scaleInt(picture.Width, imageScale); int height = utils.scaleInt(picture.Height, imageScale); this.hitBox = new HitBox(new Vector2(centerPos.X - width / 2, centerPos.Y - height / 2), width, height, Color.Black, game.Window.ClientBounds); playerCamera.Initialize(); } #region Methods public void Draw(SpriteBatch spriteBatch) { //Console.WriteLine("Hitbox: X({0}),Y({1})", hitBox.Points[0].X, hitBox.Points[0].Y); //Console.WriteLine("Image: X({0}),Y({1})", centerPos.X, centerPos.Y); Vector2 orgin = new Vector2(picture.Width / 2, picture.Height / 2); hitBox.Draw(spriteBatch); utils.DrawCrosshair(spriteBatch, Position, game.Window.ClientBounds, Color.Red); spriteBatch.Draw(picture, Position, null, Color.White, angle, orgin, imageScale, SpriteEffects.None, 0.1f); } as I said I think I'm gonna need to do something with the render position but I'm to entirely sure what or how it would be elegant to say the least

    Read the article

  • Why occlusion is failing sometimes?

    - by cad
    I am rendering two cubes in the space using XNA 4.0 and occlusion only works from certain angles. Here is what I see from the front angle (everything ok) Here is what I see from behind This is my draw method. Cubes are drawn by serverManager and serverManager1 protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); switch (_gameStateFSM.State) { case GameFSMState.GameStateFSM.INTROSCREEN: spriteBatch.Begin(); introscreen.Draw(spriteBatch); spriteBatch.End(); break; case GameFSMState.GameStateFSM.GAME: spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); // Text screenMessagesManager.Draw(spriteBatch, firstPersonCamera.cameraPosition, fpsHelper.framesPerSecond); // Camera firstPersonCamera.Draw(); // Servers serverManager.Draw(GraphicsDevice, firstPersonCamera.viewMatrix, firstPersonCamera.projMatrix); serverManager1.Draw(GraphicsDevice, firstPersonCamera.viewMatrix, firstPersonCamera.projMatrix); // Room //roomManager.Draw(GraphicsDevice, firstPersonCamera.viewMatrix); spriteBatch.End(); break; case GameFSMState.GameStateFSM.EXITGAME: break; default: break; } base.Draw(gameTime); fpsHelper.IncrementFrameCounter(); } serverManager and serverManager1 are instances of the same class ServerManager that draws a cube. The draw method for ServerManager is: public void Draw(GraphicsDevice graphicsDevice, Matrix viewMatrix, Matrix projectionMatrix) { cubeEffect.World = Matrix.CreateTranslation(modelPosition); // Set the World matrix which defines the position of the cube cubeEffect.View = viewMatrix; // Set the View matrix which defines the camera and what it's looking at cubeEffect.Projection = projectionMatrix; // Enable textures on the Cube Effect. this is necessary to texture the model cubeEffect.TextureEnabled = true; cubeEffect.Texture = cubeTexture; // Enable some pretty lights cubeEffect.EnableDefaultLighting(); // apply the effect and render the cube foreach (EffectPass pass in cubeEffect.CurrentTechnique.Passes) { pass.Apply(); cubeToDraw.RenderToDevice(graphicsDevice); } } Obviously there is something I am doing wrong. Any hint of where to look? (Maybe z-buffer or occlusion tests?)

    Read the article

  • Creating a custom ubuntu ISO

    - by ajstack
    Hi, I want to create a custom ubuntu ISO (This ISO will contain all the packages with the latest updates released till date). Something along the lines of Take the pristine ubuntu ISO Download the updates from some ubuntu update repositories Re-create the ISO? How should I go about this?

    Read the article

  • How to setup custom subdomain with Posterous blog

    - by Tahir Akram
    Hi; I want to setup my custom subdomain with my posterous blog: tahirakram.posterous.com. I am confused over setting up A record and CNAME. Do I need to set A record and CNAME both to run my posterous to this URL: blog.tahirakram.com? So far I set up CNAME Name: blog.tahirakram.com Value: posterous.com Should I set A recrod name value too? (if yes, as following) Host Name: blog.tahirakram.com Destination IPv4 Address: 67.207.139.81 Instruction given by posterous

    Read the article

  • Custom shortcut for switching keyboard input languages in Windows XP

    - by uaaquarius
    Hi, I'm using Linux for years and now I have to work with Windows XP at work. The problem is I don't like default shortcuts for switching keyboard input languages: [CTRL]+[SHIFT] and [ALT]+[SHIFT]. And I'd really like to change the shortcut to the one I'm using in Linux [SHIFT]+[SHIFT]. I've googled for a while, played with registry but have not found any solution. So, can I assign custom ([SHIFT]+[SHIFT]) shortcut for switching keyboard input languages? Thanks in advance, Andriy

    Read the article

  • Custom signature for Gmail mobile

    - by pilcrow
    Is it possible to use a custom signature for Gmail to be used only when accessed over an iPhone or other mobile device? While I don't find the Sent from my [iPhone|mobile device] siglines to be very pretty, they are a convenient way to explain and excuse the brevity and occasional typo in mobile email.

    Read the article

  • How to make a custom Windows 8 installation

    - by Nison Maël
    What is the step-by-step way to make a custom Windows 8 installation ? For example, with a minimal example, I would like an image which : Has a single user named "User" This user has Chrome and Firefox installed Has no link in the start screen except the desktop link Has no buttons on the task bar I have tried to use sysprep but I lose user settings. The CopyProfile seems to apply Administrator's settings on programmaticaly created accounts, but does not preserve local users settings accross installations.

    Read the article

  • Redirect local service to custom proxy

    - by Pedro Laguna
    Hello, I'm trying to create a custom proxy program but I have a problem. My program connects to a fixed port from a random port and I need to tunnel all this traffic by my local proxy. I think the solution is using iptables, but all the topics I found are related to redirect incoming connections, not outbounds. How can I redirect all the traffic from a local port to another local port and later to the internet? Thanks,

    Read the article

  • Make Apache server available on a LAN via custom ServerName

    - by samwatt
    Hi, is it possible to set up an Apache server on a machine which is part of a LAN, then allow machines on the LAN to access the server via a custom ServerName (instead of Localhost). I want to serve a simple website in an office space using a short ServerName (no ports etc if possible), but I want to make sure this is possible (after originally being certain it was!). THanks in advance.

    Read the article

  • HAProxy create custom routing logic

    - by kumar
    Is it possible to write a custom routing logic for HAProxy. I need it in such a way that each application server is allocated a max on 1000 TCP connections then only should the loadbalancer try to route next TCP request to next application server. if not with HAProxy if there any other Load balancer that can do it please let me know. Can persistence be applied to TCP connections. There will no HTTP request. thanks

    Read the article

  • Package Managers and Custom Installs?

    - by Miko
    Is it possible to use custom installs in conjunction with the package manager? For example, I would like to use apt-get to install EngineX because it will also install all the applicable dependencies. However, I prefer to use version 0.8.34 which I then configure to include modules that EngineX does nt come with by default. Is there some way for me to get the best of both worlds?

    Read the article

  • Custom Windows hotkey to refresh browser window

    - by Prez
    I work in a double screen environment where I write code on one screen and preview the results in the other (containing Firefox, Chrome etc.). It would be great if I could somehow make the browser window refresh without manually switching to the browser. So while I write code, I would like to push, for example, Ctrl+Alt+R and the browser window would refresh without any extra effort on my side. Is there any software that could help me to set up such custom hotkey?

    Read the article

  • Problem getting puppet to sync custom fact

    - by byron-appelt
    I am having trouble getting puppet to sync a custom fact. I am using puppet version 0.25.4. The fact is inside a module as described in http://docs.reductivelabs.com/guides/plugins_in_modules.html If I specify --pluginsync on the command line it does sync correctly, but does not otherwise even though I have pluginsync=true in my puppet.conf. Is it correct that this command line option and the option in the puppet.conf should have the same behavior?

    Read the article

  • Anyone heard of a custom report builder program?

    - by user19189
    Hi, I'm looking for a program to create and store custom reports. What I want to be able to do is build a report by adding fields for end users to fill out and then have the program create the appropriate database (or update the appropriate database table rows). So, just a simple report that can be created entirely by an end user from the front end. Thanks in advance

    Read the article

  • Custom hostname instead ISP's

    - by JohnZ
    Hi! I have setup a Centos 5.5 server and a domain name (say mydomain.com) pointing to it (using bind9) with custom nameservers (like ns1.mydomain.com and ns2.mydomain.com). Everything works fine but there is something more I would like to have and don't know if it is possible. Is it possible to have the returned host to be mydomain.com (PHP gethostbyaddr()), not host-static-x-y-a-b.myisp-provider.com? And how do I implement it if it's possible?

    Read the article

  • Problem with custom 404 page

    - by user33687
    Don't know if this question is appropriate here. I created an Alias directed to the root folder of the website (right now running on localhost). In the root folder, I have a custom 404 page, and I've added a .htaccess file in that folder with the "ErrorDocument 404 /404.html" line, but it still doesn't work. I'm pretty new to this stuff (web servers), so I must be missing something obvious. Any suggestions greatly appreciated.

    Read the article

  • Set a custom start date for week numbers

    - by Graham Wager
    Outlook has the ability to show week numbers down the side of the calendar in monthly view, and on the mini-calendar: In options, you can set the first week of the year, but only to the following three options: This is all very nice, but at work our "year" starts on a different date to match up with accounting periods - it's currently week 37 rather than 45! I'd like Outlook to be able to tell me which week it is at work, so is there any way I can set a custom date to be the first week of the year?

    Read the article

  • Is it possible to install custom software on Amazon EC2

    - by quickquestioner
    I'm trudging through the Amazon docs for a quick answer, but while I'm looking I thought it wouldn't hurt to ask here. My client uses custom software that uses (wait for it) Microsoft Excel to store data as opposed a RDBMS. Either way, their server is outdated and they are interested in using Amazon's cloud services, but would installing this software be possible, or am I barking up the wrong tree? Links are welcome! Thanks for your help!

    Read the article

  • CMAK Custom Action to run synchronous executable

    - by Charles Gargent
    I am using the Connection Manager Administration Kit (CMAK) to create vpn connections for my users, if it is possible how do I create a custom action that launches an executable that runs synchronously? In the help file it says Only DLLs run synchronously, meaning that Connection Manager starts the action and then waits for the function to return before continuing Is there any way around this? I have seen something similar called VPN-Q which from the screen shots appear to do just that.

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >