Daily Archives

Articles indexed Friday June 6 2014

Page 13/17 | < Previous Page | 9 10 11 12 13 14 15 16 17  | Next Page >

  • dot42 vs Xamarin to develop in C# for Android phones [on hold]

    - by opt
    does anyone have experience with both dot42 and Xamarin to develop C# apps for Android? Could you please say why one should prefer one over the other? I like the free Visual Studio integration that is offered by dot42 (while Xamarin requires a subscription for this, and the business one which is quite expensive). I would also like to know if Visual Studio integration actually means that one could use all libraries available for desktop apps. Thank you.

    Read the article

  • Interface hierarchy design for separate domains

    - by jerzi
    There are businesses and people. People could be liked and businesses could be commented on: class Like class Comment class Person implements iLikeTarget class Business implements iCommentTarget Likes and comments are performed by a user(person) so they are authored: class Like implements iAuthored class Comment implements iAuthored People's like could also be used in their history: class history class Like implements iAuthored, iHistoryTarget Now, a smart developer comes and says each history is attached to a user so history should be authored: interface iHistoryTarget extends iAuthored so it could be removed from class Like: class Person implements iLikeTarget class Business implements iCommentTarget class Like implements iHistoryTarget class Comment implements iAuthored class history interface iHistoryTarget extends iAuthored Here, another smart guy comes with a question: How could I capture the Authored fact in Like and Comment classes? He may knows nothing about history concept in the project. By scalling these kind of functionallities, interfaces may goes to their encapsulated types which cause more type strength, on the other hand explicitness suffered and also code end users will face much pain to process. So here is the question: Should I encapsulate those dependant types to their parent types (interface hierarchies) or not or explicitly repeat each type for every single level of my type system or ...?

    Read the article

  • Does OO, TDD, and Refactoring to Smaller Functions affect Speed of Code?

    - by Dennis
    In Computer Science field, I have noticed a notable shift in thinking when it comes to programming. The advice as it stands now is write smaller, more testable code refactor existing code into smaller and smaller chunks of code until most of your methods/functions are just a few lines long write functions that only do one thing (which makes them smaller again) This is a change compared to the "old" or "bad" code practices where you have methods spanning 2500 lines, and big classes doing everything. My question is this: when it call comes down to machine code, to 1s and 0s, to assembly instructions, should I be at all concerned that my class-separated code with variety of small-to-tiny functions generates too much extra overhead? While I am not exactly familiar with how OO code and function calls are handled in ASM in the end, I do have some idea. I assume that each extra function call, object call, or include call (in some languages), generate an extra set of instructions, thereby increasing code's volume and adding various overhead, without adding actual "useful" code. I also imagine that good optimizations can be done to ASM before it is actually ran on the hardware, but that optimization can only do so much too. Hence, my question -- how much overhead (in space and speed) does well-separated code (split up across hundreds of files, classes, and methods) actually introduce compared to having "one big method that contains everything", due to this overhead? UPDATE for clarity: I am assuming that adding more and more functions and more and more objects and classes in a code will result in more and more parameter passing between smaller code pieces. It was said somewhere (quote TBD) that up to 70% of all code is made up of ASM's MOV instruction - loading CPU registers with proper variables, not the actual computation being done. In my case, you load up CPU's time with PUSH/POP instructions to provide linkage and parameter passing between various pieces of code. The smaller you make your pieces of code, the more overhead "linkage" is required. I am concerned that this linkage adds to software bloat and slow-down and I am wondering if I should be concerned about this, and how much, if any at all, because current and future generations of programmers who are building software for the next century, will have to live with and consume software built using these practices. UPDATE: Multiple files I am writing new code now that is slowly replacing old code. In particular I've noted that one of the old classes was a ~3000 line file (as mentioned earlier). Now it is becoming a set of 15-20 files located across various directories, including test files and not including PHP framework I am using to bind some things together. More files are coming as well. When it comes to disk I/O, loading multiple files is slower than loading one large file. Of course not all files are loaded, they are loaded as needed, and disk caching and memory caching options exist, and yet still I believe that loading multiple files takes more processing than loading a single file into memory. I am adding that to my concern.

    Read the article

  • Should I use JavaFx properties?

    - by Mike G
    I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code design dependent on JavaFx, which I feel I should not being doing. I should be able to change the view without changing too much of the model and controller. So should I ignore the convenience of JavaFx properties, or should I embrace them and the fact that it reduces my codes flexibility.

    Read the article

  • At the end of my rope

    - by hvgotcodes
    I am a contractor to a big company. Currently, there are three developers on the project, myself included. The problem is the other 2 developers don't really get it. By "it" i mean the following: They don't understand the best practices for the technology we are using. After 6 months of me and others giving them examples there are terrible anti-patterns being used. They are "copy and paste" programmers that produce primarily spaghetti code. They constantly break things, implementing changes but not doing a basic smoke test to see if all is good They refuse/rarely to ask for code-reviews. They refuse/rarely even do basic things like formatting code. No documentation on any classes (jsdocs) Afraid to delete code that doesn't do anything Leave commented code blocks everywhere even though we have version control. I find myself getting more and more frustrated as I format others code, fix bugs, discover functionality that is broken, and create abstractions to remove the spaghetti. I really don't know what to do. I try not to get to frustrated, but it's just a mess. I like these people as people, but I feel like the coding situation is so bad that I could move faster if they simply browsed the web all day. Would it be out of line to ask our manager to review the others svn commit access; commits can only be done after a review by someone who is knowledgeable in what we are doing? As a contractor, I'm not sure if that's the best move. Is there a subtle/not so subtle way of making it clear how many things I am fixing?

    Read the article

  • -ln links to wrong file

    - by user289075
    I've just installed matlab and want to be able to call it from the terminal. It works fine when I explicitly call it from its directory. I cd to /usr/local/bin and type sudo ln -s /usr/local/MATLAB/R2012a/bin/matlab matlab when I then type "matlab" in the terminal, I get the error message "bash: /media/OS/MATLAB/bin/matlab: No such file or directory" I have no idea why it's trying to call matlab from /media. I've tried deleting the file from usr/local/bin but when I create it again the same thing happens. Any help would be very much appreciated.

    Read the article

  • How can we add arch specific conflicts tag when building .deb package?

    - by Sphopale
    We are trying to build multi-arch supported i386 .deb package. There are two .deb packages build on i386 X1 & X2 (X2 is a subset of X1 binaries). X1 <- X2 conflict each other when installing . Only one .deb package can be installed at any instance. We similarly have binaries on xa64 arch. Again on xa64, there are two .deb packages X1 & X2 (X2 is a subset of X1 binaries). X1 <- X2 conflict each other when installing . Only one .deb package can be installed at any instance. In case of multi-arch i386 .deb package,i386 .deb packages (X1 & X2) can be installed on xa64 along side with 64bit (X1 & X2) However I see that when installing X1:i386 & X1:amd64 can co-exist However, it throws conflict error when trying to install X1:i386 & X2:amd64 In short, Can we mark package to conflict based on arch Conflict: X2:i386 X1:i386 package should only conflict with X2:i386 & allow other packages to co-exist X1:amd64 package should only conflict with X2:amd64 & allow other packages to co-exist X1:i386 can co-exist with X1:amd64 OR X2:amd64 X2:i386 can co-exist with X1:amd64 OR X2:amd64 Thanks for your reply

    Read the article

  • Bash script runs fine, but not in cron

    - by radiotech
    I have a script that's supposed to record a shoutcast stream for an hour, convert it to mp3, and then save it. The script runs correctly when I run it from the terminal, but I can't seem to get it to run in cron (where it should run every hour at the top of the hour). Here's the line in crontab: 0 * * * * /medialib/tech/bin/recordstream 2>&1 >> /medialib/tech/cron.log and here's the script: #!/bin/bash name="$(date +%s)" mp3_name=$name.mp3 wav_name=$name.wav timeout -sHUP 60m vlc -I dummy --sout "#transcode{channels=2}:std{access=file,mux=wav,dst=/medialib/stream_backup/wav/$wav_name" /medialib/tech/lib/listen.m3u lame --mp3input /medialib/stream_backup/wav/$wav_name /medialib/stream_backup/$mp3_name rm /medialib/stream_backup/wav/$wav_name Thank you! EDIT: Contents of cron.log (This text has been in the log file since it was transferred from an old server where it was working). VLC media player 2.0.8 Twoflower Command Line Interface initialized. Type `help' for help. > Shutting down. VLC media player 2.0.8 Twoflower Command Line Interface initialized. Type `help' for help. > Shutting down.

    Read the article

  • Install Ubuntu on Mac OS X Mavericks, MacBook Air

    - by Unknown
    I was wondering if its okay to install Ubuntu on my Macbook Air, and if it is okay please let me know the procedure. I would prefer to do it by NOT using reFind (not sure what the name is). The following is my system specification. Hardware Overview: Model Name: MacBook Air Model Identifier: MacBookAir6,2 Processor Name: Intel Core i5 Processor Speed: 1.3 GHz Number of Processors: 1 Total Number of Cores: 2 L2 Cache (per Core): 256 KB L3 Cache: 3 MB Memory: 8 GB System Software Overview: System Version: OS X 10.9.2 (13C1021) Kernel Version: Darwin 13.1.0 Boot Volume: Macintosh HD Boot Mode: Normal MacBook Air (13-inch Mid 2013), OS X Mavericks (10.9.2)

    Read the article

  • How to split currently used partition on Ubuntu server?

    - by KrizzzyS
    I would like to split a currently used partition that is mounted to /usr directory. I did this because / only had 1 gb of data allocated to it. Now, I did not account for the /home directory when I made this partition (or I would have made two partitions). So I have 14 gb mounted to usr/ with 12 gb free. Is there a way I can reclaim the free space on this partition to make another partition to mount to /home? Here is the result of a df -h: I have tried to split the /dev/mmcblk1p4 into 2 different partitions but I was not able to save the partition table correctly.

    Read the article

  • Gparted Partition Mount Points Alternate Between 2 Physical Disk Drives

    - by California Ken
    I'm running Ubuntu Server 14.04 on a system with 2 physical disk drives. I am frequently seeing mount errors on startup. When I check the drive partitions using GPARTED, I see that my two "non-system created" data partitions have the wrong disk assignments (i.e. sda1 vs sdb1) or visa-versa. If I hand edit /etc/fstab to match GPARTED, the system will boot error free one time. On the second restart I will get the "serious mount problem" error for the 2 data partitions and when I check GPARTED, the disk assignments have changed again (again, GPARTED and fstab don't match). A listing of my /etc/fstab is: /etc/fstab: static file system information. # Use 'blkid' to print the universally unique identifier for a device; this may be used with UUID= as a more robust way to name devices that works even if disks are added and removed. See fstab(5). # / was on /dev/sdb2 during installation UUID=766a06a4-e5af-484a-adf0-fa1e88da7212 / ext4 errors=remount-ro,user_xattr,acl,barrier=1 0 1 swap was on /dev/sda6 during installation UUID=8c42f835-ead3-43fb-88d8-196f5dfc3aa7 none swap sw 0 0 swap was on /dev/sdb3 during installation UUID=2214deec-ba98-47da-aea7-4e46998f3e57 none swap sw 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0 /dev/sda1 /media/ken/Linux-Data ext3 defaults 0 2 /dev/sda5 /media/ken/Data2 ext4 defaults 0 2 The device designations in the last 2 lines are the ones in question. The fstab entries to NOT change between system restarts but the mount points in the GPARTED display do. Does anyone have a fix for this? Thanks Mr. Young and Mr Gedak, Following is my fstab file and two blkid outputs. The fstab output is correct. The first blkid output was after a reboot and is WRONG! The sda and sdb device partition data is reversed. The 2nd blkid output was after a second reboot (fstab not changed). It shows the sda and adb partition data CORRECTLY. I didn't see any duplicate UUIDs. Does anyone have any idea why the GPARTED and blkid outputs alternate on consecutive reboots? The alternating partition data is real since when the partition assignments are reversed, the boot sequence halts with disk mounting errers (I have to press "s" to skip the mounts). Thanks again. Ken I copied the contents of a text file showing my fstab and 2 blkid outputs. The text file contents show up in the text entry box but does not appear in the main body of the question. Is there a way I can attach the text file or edit this question so that the text is displayed for question viewers?

    Read the article

  • AR9485 wireless card loses ability to connect after hibernation

    - by DrewDiezel
    This has happened twice now, the first time it happened I just reinstalled Ubuntu. The only things that I've been messing with in terms of networking, have been restarting the network-manager service after I resume from hibernate (because it never works right after resume, but restarting the service fixes that), and changing my mac address with ifconfig wlan0 down && ifconfig wlan0 hw ether 11:22:33:44:55 && ifconfig wlan0 up. using tail | dmesg returns a bunch of attempts to connect, saying something like authenticating ... okay you're connected! now I'm going to just disconnect because I feel like it. (reason=3). Any ideas? If it helps maybe I'll add a picture of the tail|dmesg output later. My wireless drivers are as follows: Atheros AR9485 Wireless Network Adapter Hamachi Network Interface Microsoft Virtual Wifi Miniport Adapter Realtek PCIe GBE Family Controller VirtualBox Host-Only Ethernet Adapter Here is a pastebin of some terminal outputs that could help. Also, the reddit thread has a few answers, for anyone curious. It's located here. It is entirely possible that it's just my school wifi blocking out my laptop, and my home wifi sucks. Wifi does work at places other than my home and school, however my phone can connect to both places. Here is a pastebin of the results of the wireless-info script.

    Read the article

  • How to establish VPN Connection using Vodafone K3773 HSPA USB Stick?

    - by user1889139
    I am using Ubuntu 12.04 Desktop. I am trying to establish VPN PPTP connection to Ubuntu 12.04 Server. VPN connection available when PC is connected to LAN - ADSL modem - Internet - VPN Server. No VPN connection available when using 3G modem Vodafone K3773 HSPA USB Stick - Internet - VPN Server. Internet is connected. VPN is not. How to establish the VPN Connection? Server side log: GRE: Bad checksum from pppd.

    Read the article

  • How to troubleshoot ethernet port on laptop

    - by Psallas Vassilios
    I have a problem with my wired connection. To be more specific, my laptop doesn't seems to recognize that I have plugged in an ethernet cable. I tried to download new drivers for my ethernet card, but I couldn't find any solutions. Maybe because I am new to Linux, so I'm not familiar with running commands in the terminal. OK I have typed the command and here are the results: 00:04.0 Ethernet controller [0200]: Silicon Integrated Systems [SiS] 191 Gigabit Ethernet Adapter [1039:0191] (rev 02) For the second reply I don't know if the following is what you asked me: ?Memory: 3.9 GiB ?Processor: Intel Core 2 Duo CPU P8800 @ 2.66GHz × 2 ?OS type: 32-bit My Ethernet connection had some problem on Windows too. I have changed recently my internet provider, and since then my ethernet cable is not recognized by the laptop. At that time I was still on Windows. I thought that with Ubuntu the problem would be solved, but unfortunately the problem still persists. If someone can help me to solve my problem I'll be thankful. Here are the results of the three first commands you told me to run: lsmod | grep sis190 sis190 22570 0 sudo modprobe sis190 ifconfig eth0 Link encap:Ethernet HWaddr 00:90:f5:90:81:7e UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:185 errors:0 dropped:0 overruns:0 frame:0 TX packets:185 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:22672 (22.6 KB) TX bytes:22672 (22.6 KB) wlan0 Link encap:Ethernet HWaddr 00:25:d3:2c:3a:ae inet addr:192.168.1.72 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::225:d3ff:fe2c:3aae/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:260 errors:0 dropped:0 overruns:0 frame:0 TX packets:363 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:71992 (71.9 KB) TX bytes:52000 (52.0 KB) and the results of running the last two commands: dmesg | grep -e eth -e sis190 [ 0.816667] sis190: sis190 Gigabit Ethernet driver 1.4 loaded [ 0.816728] sis190 0000:00:04.0: setting latency timer to 64 [ 0.816751] sis190: 0000:00:04.0: Read MAC address from EEPROM [ 0.904032] sis190: 0000:00:04.0: Realtek PHY RTL8201 transceiver at address [ 1.416030] sis190: 0000:00:04.0: Using transceiver at address 1 as default [ 1.448235] sis190 0000:00:04.0: eth0: 0000:00:04.0: SiS 191 PCI Gigabit Ethernet adapter at f8410000 (IRQ: 19), 00:90:f5:90:81:7e [ 1.448238] sis190 0000:00:04.0: eth0: GMII mode. [ 1.448243] sis190 0000:00:04.0: eth0: Enabling Auto-negotiation [ 11.560907] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 16.372019] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 16.372265] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 26.424038] sis190 0000:00:04.0: eth0: auto-negotiating... nm-tool NetworkManager Tool State: connected (global) - Device: eth0 ----------------------------------------------------------------- Type: Wired Driver: sis190 State: unavailable Default: no HW Address: 00:90:F5:90:81:7E Capabilities: Carrier Detect: yes Wired Properties Carrier: off

    Read the article

  • How do I install pgAdmin III for postgreSQL 9.2?

    - by Vector
    I have a Windows server that runs postgresql 9.2. I want to hit it using pgAdmin III from my Ubuntu 12.10 workstation box. I installed pgAdmin III from synaptic and also tried direct download from postgreSQL site using software installer. Regardless, I can get only get pgAdmin III for postgresql 9.1. When I run pgAdmin III and point to my server I get an error message telling me that the database is 9.2 and my pgAdmin III is for 9.1, isn't compatible with 9.2. I can access the server itself fine OK from the Ubuntu box - I have Python programs that hit the database with no problems - but I need pgAdmin III for 9.2 running under Ubuntu 12.10. Is it available? Where do I get it?

    Read the article

  • update-grub is setting a wrong linux root partition

    - by adrian m
    Initially, Ubuntu was installed on another partition (sda5 or sda4). At some point I did manually move the root partition to sda2. Now, the problem is that whenever a new kernel is installed, the automatic regeneration of the menu.lst is using the OLD Linux partition. So I have to manually change in menu.lst the lines : root (hd0,5) into root (hd0,1) How can I configure update-grub to automatically generate menu.lst with the current Linux root partition? I assume that the (hd0,5) was written somewhere at installation, but I couldn't find it.

    Read the article

  • Is it possible to track redirects to external sites from our subdomains?

    - by ChaBuku
    I have a handful of subdomains set up as redirects because we are using them for QR codes. I want to be able to track the QR code redirects (which are already set up and printed so no changing them at this point) and see the effectiveness of each. Here's two examples: http://qr.glorkianwarrior.com and http://ad.glorkianwarrior.com are set up to forward to our iTunes page (later on this year it may forward to Google Play or a specific landing page), is there any way on my server to track the redirect from the subdomain to iTunes and see where traffic is coming from first? I have the redirects set up through cPanel presently using subdomains. Edit: From the research I've seen I can't track a 301 directly. If I redirect to an internal page and then do a timed redirect to the iTunes link, how long will it take for the tracking script to track a hit?

    Read the article

  • How to get started on working with WebTrends locally using a DEV account access? [on hold]

    - by Knowledge Craving
    I'm a newbie developer on WebTrends Analytics, although I have worked extensively on Adobe SiteCatalyst. Currently I want to integrate WebTrends with the web pages of a local project on my local JBoss EAP application server, so that I can run it locally and see how WebTrends work, along with how the Analytics reports show up. Later on, I may customize the reports data as per the project requirements. However, I can't find anywhere how I can start working on a local development process using a DEV account access. I'm mainly trying to get data on number of user visits per day, as of now, which will cater to multichannel experience. And later on, I will start pulling more data based on targeting and segmentation. Can anyone of you please help and guide me in the right direction? Any help is highly appreciated. Thank you!

    Read the article

  • How to prevent Google from indexing non-domain URL of website?

    - by Gavin
    My webhost gives you two URLs for your website: the URL on your shared server, which is something like usr283725992783.webhost.com and your domain URL, which is www.example.com Google is indexing both of these URLs, but obviously I only want www.example.com to be indexed. I can't add "nofollow" tags to usr283725992783.webhost.com because that URL serves the same files as www.example.com. How can I only make Google not follow usr283725992783.webhost.com and keep following www.example.com?

    Read the article

  • Revamped Joomla site to Google search engine

    - by user3127632
    I am about to upload a revamped site of Joomla (update from 1.5 to 2.5 + changes). I currently have a test bed subdomain that I am currently working on. In few days I am about to do the swap and replace the old site with the new one. I am worrying about Search Engines and specifically Google. The site currently has a very good rank (appears 2nd in the search), what actions do I have to take in order to be updated and preserve the rank? (except submitting the new sitemap I guess). It's not a difficult task but because I don't have the option to be wrong or mistakes to be done I an asking for a more "expert" advice.

    Read the article

  • Google Analytics conversion tracking - referrals from payment provider

    - by martynas
    I have a question regarding conversion tracking using Google Analytics. My client uses an external payment service provider - SecureTrading. Problem: All website visitors who would like to make a purchase are taken to a payment form on https://securetrading.net and are redirected back after a successful payment. Google Analytics counts that as a referral and messes up conversion tracking stats. Question: What needs to be changed / added in the payment forms or Google Analytics settings so that the conversions would be assigned to the right traffic sources. Screenshot:

    Read the article

  • LibGdx, Texture an Object

    - by Gigi10012
    I want to set texture to an Object, this is my playerobject class: private boolean up; private float speed; private float fallacceleration = 20; private float acceleration = 15; private float maxSpeed = 300; SpriteBatch batch; public Player() { x = MyGdxGame.WIDTH - 9*MyGdxGame.WIDTH/10; y = MyGdxGame.HEIGHT - 3 * MyGdxGame.HEIGHT/10; shapex = new float[4]; shapey = new float[4]; radians = 2*MathUtils.PI; batch = new SpriteBatch(); } private void setShape() { //Simple Arrow Shape ...... } public void update(float dt) { setShape(); } public void draw(ShapeRenderer sr) { sr.setColor(0F, 0F, 0F, 1F); sr.begin(ShapeType.Line); //Drawing Shape .............. sr.end(); } What I have to do to add texture to that object? (I'm using LibGdx)

    Read the article

  • How to manage Areas/Levels in an RPG?

    - by Hexlan
    I'm working on an RPG and I'm trying to figure out how to manage the different levels/areas in the game. Currently I create a new state (source file) for every area, defining its unique aspects. My concern is that as the game grows the number of class files will become unmanageable with all the towns, houses, shops, dungeons, etc. that I need to keep track of. I would also prefer to separate my levels from the source code because non-programmer members of the team will be creating levels, and I would like the engine to be as free from game specific code as possible. I'm thinking of creating a class that provides all the functions that will be the same between all the levels/areas with a unique member variable that can be used to look up level specifics from data. This way I only need to define level/area once in the code, but can create multiple instances each with its own unique aspects provided by data. Is this a good way to go about solving the issue? Is there a better way to handle a growing number of levels?

    Read the article

  • Slick UnicodeFont displays in different location depending on the screen size?

    - by Joehot2000
    I am using the Slick2D library to draw text. The text draws perfectly, however it is in the wrong location! I could easily draw it in the correct location, however the problem is that the "correct location" is very different depending on the size of the screen - And my game needs to be able to have the screen size changed. Here is the render method for the text: public static void render() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glUseProgram(0); glBindBuffer(GL_ARRAY_BUFFER, 0); glMatrixMode(GL_PROJECTION); glLoadMatrix(orthographicProjectionMatrix); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glDisable(GL_LIGHTING); font.drawString(0, 0, "OMG ITS TEXT!", Color.green); glEnable(GL_LIGHTING); glPopMatrix(); glMatrixMode(GL_PROJECTION); glLoadMatrix(perspectiveProjectionMatrix); glMatrixMode(GL_MODELVIEW); } So, how can I set the text to be in the middle of the screen irrespective of screen size? Thanks!

    Read the article

  • How to remove seams from a tile map in 3D?

    - by Grimshaw
    I am using my OpenGL custom engine to render a tilemap made with Tiled, using a well spread tileset from the web. There is nothing fancy going on. I load the TMX file from Tiled and generate vertex arrays and index arrays to render the tilemap. I am rendering this tilemap as a wall in my 3D world, meaning that I move around with a fly camera in my 3D world and at Z=0 there is a plane showing me my tiles. Everything is working correctly but I get ugly seems between the tiles. I've tried orthographic and perspective cameras and with either I found particular sets of parameters for the projection and view matrices where the artifacts did not show, but otherwise they are there 99% of the time in multiple patterns, depending on the zoom and camera parameters like field of view. Here's a screenshot of the artifact being shown: http://i.imgur.com/HNV1g4M.png Here's the tileset I am using (which Tiled also uses and renders correctly): http://i.imgur.com/SjjHK4q.png My tileset has no mipmaps and is set to GL_NEAREST and GL_CLAMP_TO_EDGE values. I've looked around many articles in the internet and nothing helped. I tried uv correction so the uv fall at half of the texel, rather than the end of the texel to prevent interpolating with the neighbour value(which is transparency). I tried debugging with my geometry and I verified that with no texture and a random color in each tile, I don't seem to see any seams. All vertices have integer coordinates, i.e, the first tile is a quad from (0,0) to (1,1) and so on. Tried adding a little offset both to the UV and to the vertices to see if the gaps cease to exist. Disabled multisampling too. Nothing fixed it so far. Thanks.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17  | Next Page >